clear textinput react native
"CLEAR TEXT FROM INPUT FIELD IN REACT NATIVE, WHEN CLICK SUBMIT BUTTON"
const [textInput, setTextInput] = useState() //this state always holds the text
const submitHandler = () => { //runs on submit and sets the state to nothing.
setTextInput("")
}
const changeHandler = (value) => { //grabs textinput value and puts it in state
setTextInput(value);
}
return(
<TextInput
onSubmitEditing={submitHandler} //when click on "done" button on keyboard
onChangeText={changeHandler} //when text is changed, add it to the state.
value={textInput} //text inside is always the same as in our state.
/>
)
Also in JavaScript:
- firebase auth sign out javascript
- logical nullish operator javascript
- how to get csrf token in javascript
- reload ajax datatable
- first child element javascript
- npm http angular
- plyr for react js
- setimmediate not working
- how to delete a line in vs code
- animated list in js
- jquery ready function
- vue htmlWebpackPlugin.options.title
- check if date is today js
- javascript function with input value
- how ot get browser is safari in chrome
- configure column menu in kendo grid angular to hae only locked
- js var part of var name
- busca binária em javascript
- on reload js
- how to wait for a function to finish in javascript
- quiz javascript example with array
- how to make javascript make things disappear
- find leap year javascript
- javascript write to text file