react-native

How to open keyboard automatically in React Native?


I have a screen in my React Native application in which I have few text fields.

I was wondering if there is any way in which on screen load my keyword opens automatically and focuses on my first text input field?

I was searching for something like stateAlwaysVisible in android.


Solution

  • The keyboard should open automatically when <TextInput /> is focused. You can use the autoFocus prop to make it focus when the element mounts (link)