All components support touch handling through the framework's event system. All components can handle the following events by default:
This means all layout builders have an
EventHandler prop named
touchHandler respectively. Specify the event class you want to handle as an argument to the
For example, setting a click handler on any component is as simple as:
And the callback within MyComponentSpec would look like this:
You can expand the interactive bounds of a component by using the touch expansion APIs in the layout builder:
In this example, the clickable bounds of the text component will be 10 dips larger on all edges (left, top, right, bottom).