Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pablocattaneo/e0aed3104a8c36c339fb1be22ede5d7b to your computer and use it in GitHub Desktop.
Save pablocattaneo/e0aed3104a8c36c339fb1be22ede5d7b to your computer and use it in GitHub Desktop.
// The type for the event is NativeSyntheticEvent<TextInputChangeEventData>
// example 1
import { TextInput, NativeSyntheticEvent, TextInputChangeEventData } from "react-native";
const onChange = (e: NativeSyntheticEvent<TextInputChangeEventData>): void => {
const value = e.nativeEvent.text;
doStuff(value);
}
// eample 2
import { NativeSyntheticEvent, TextLayoutEventData } from "react-native"
const onTextLayout = (event: NativeSyntheticEvent<TextLayoutEventData>) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment