react native autofocus on text input with keyboard display
const [isFocused, setIsFocued] = React.useState(true)
const setFocus = React.useCallback(() => {
setIsFocued(true)
}, [])
const setBlur = React.useCallback(() => {
setIsFocued(false)
}, [])
const navi = useNavigation()
React.useEffect(() => {
navi.addListener('focus', setFocus)
navi.addListener('blur', setBlur)
return () => {
navi.removeListener('focus', setFocus)
navi.removeListener('blur', setBlur)
}
}, [])
return (
<View>
{focused && <TextInput autoFocus />}
</View>
)
Also in JavaScript:
- draw point p5js
- firestore update array
- content of page fully loaded javascript
- chart.js y axis maximum value
- fetch api in js
- javascript Convert an array of objects to a single object
- import all from javascript
- how to remove a value from an array and return the new array in javascript
- javascript set and get cookie
- what is node in selenium grid
- node js find directory change directory
- array sorting javascript mergesort
- how to deploy react app firebase
- react starter kit 2020
- javascript resize event
- what is a javascript method
- jquery fedein background color
- array index javascript show only first 2 elements
- nodejs add to array
- js replace text link with anchor tags
- switch two values each case js
- pdfjs get all the text present
- remove last element from array javascript
- js match true false