What is textinput?
- React native Component to take user inputs
Examples
Convert text to Pizza
|
1. import TextInput from react-native 2. Local variable to store text entered in textinput textbox 3. View Component with padding=10. padding defines space b/w page top and box 4. define textinput inside View Props of textInput 1. onChangeText(Prop for TextInput): triggers a function every time the text in the input field changes.
onChangeText(text) function returns user entered text in newText. call setText(newText). Now, text = newText 5. This is another element shown below TextInput. We will show text variable in this component. |