I'm a novice developer. I have a project that requires a barcode scanner. which is developed with react native. I want to hide the keyboard. I can hide it but when I open the app and fold it and reopen it. My cursor is out of focus. And if I press any other area in the app, my cursor will not focus as well. I want to know why and solutions for this. Thank you for the advice :,
My app only works on android 7.
const dataInput = useRef(null)
const [data, setData] = useState('')
useEffect(() => {
setData('')
dataInput.current.focus()
}, [isFoucs])
<TextInput
value={data}
onChangeText={e => setData(e)}
returnKeyType="go"
ref={dataInput}
onSubmitEditing={checkData}
showSoftInputOnFocus={false}
/>