1

I am using react native hook. I want to focus on the next textinput when I press Next. I get the error 'focus' is not defined. What is the cause and remedy?

const ref_input = useRef();

<TextInput
    ..
    returnKeyType={'next'}
    onSubmitEditing={() => ref_input.current.focus()}/>
<TextInput
    ..
    ref={ref_input}/>
aliosmankepir
  • 139
  • 10
  • Does this answer your question? [React Native: How to select the next TextInput after pressing the "next" keyboard button?](https://stackoverflow.com/questions/32748718/react-native-how-to-select-the-next-textinput-after-pressing-the-next-keyboar) – MoreFoam Jan 18 '21 at 02:40
  • Try to `useRef(null)`. https://reactjs.org/docs/hooks-reference.html#useref – OAslan Jan 18 '21 at 14:05
  • Thanks for comment. Not working. – aliosmankepir Jan 18 '21 at 22:14

0 Answers0