SoF
SoF

Reputation: 787

Difference between TextInput from "react-native" and "react-native-gesture-handler"?

What is the difference between TextInput import from "react-native" and "react-native-gesture-handler"?

Upvotes: 8

Views: 2719

Answers (1)

1mike12
1mike12

Reputation: 3453

I too was wondering abou this, but from looking at the source, we can see that the gesture handler version is just a wrapper around the base TextInput. export const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);

And online they explain that createNativeWrapper as

"Creates provided component with NativeViewGestureHandler, allowing it to be part of RNGH's gesture system."

So I think if you use the wrapped one, it will give you access to all sorts of gestures, like pinching, panning, long press etc that the base input doesn't have

Upvotes: 10

Related Questions