Grokking React Native
Vote

0% completed

​

Common Event Handlers in React Native

Which prop should you use when the user taps a row, types a letter, holds a finger down, leaves a text field, or scrolls a list? Each of these actions has its own prop, and all of them follow the pattern you have already seen: write a function and pass it to the component.

The sections below add these props one at a time to a grocery screen. The screen has a search box at the top and a scrolling list of items below it. The complete code appears at the end.

Detecting a Tap with onPress

Start with one row. `Pressable

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content