title: Previous TextInput autoFocus on backspace press react-native android
body: <p>I want to move cursor focus on the previous textInput on a screen. onkeyPress is not working because that functionality is only for IOS platform not for Android. So how can I prevent this method in Android platform?</p>
  
  <p>Example code of TextInput: </p>
  
  <pre><code>          &lt;TextInput style = {styles.input}
              keyboardType='numeric'
              maxLength={1}
              ref="otpcode1"
              onChangeText={(event) =&gt; {
                this.setState({otp1: event});
                this.refs.otpcode2.focus() }}
              underlineColorAndroid='#fff'/&gt;
  
            &lt;TextInput style = {styles.input}
              keyboardType='numeric'
              maxLength={1}
              ref="otpcode2"
              onChangeText={(event) =&gt; {
                this.setState({otp2: event});
                this.refs.otpcode3.focus() }}
              underlineColorAndroid='#fff'/&gt;
  
            &lt;TextInput style = {styles.input}
              keyboardType='numeric'
              maxLength={1}
              ref="otpcode3"
              onChangeText={(event) =&gt; {
                this.setState({otp3: event});
                this.refs.otpcode4.focus() }}
              underlineColorAndroid='#fff'/&gt;
  
           &lt;TextInput style = {styles.input}
              keyboardType='numeric'
              maxLength={1}
              ref="otpcode4"
              onChangeText={(event) =&gt; {
                this.setState({otp4: event});
                console.log(this.state) }}
              underlineColorAndroid='#fff'/&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mbSJ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mbSJ9.png" alt="TextInput view screen example"></a></p>