Closed hmyjyghh closed 10 months ago
ref + useEffect + setTimeout
ref + useEffect 用了 , setTimeout 没用
useEffect(() => {
textInputRef.current && textInputRef.current.focus()
}, [show])
<TextInput ref={textInputRef}
用setTimeout 可以了
useEffect(() => {
setTimeout(() => {
textInputRef.current && textInputRef.current.focus()
}, 100)
}, [show])
👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.
Modal 组件中使用TextInput,Android 键盘不能自动弹起
Rn环境/版本信息
预期结果