I am still currently developing my simple calculator to know the basics of React Native and also researching online and the original react native documentation and I stumbled upon this problem.
my code:
{/****** TEXT INPUT CONTAINER ******/}
<View style={styles.textInputContainer}>
{/****** TEXT INPUT 1 ******/}
<TextInput style={styles.textInput1}
underlineColorAndroid="transparent"
placeholder = {" Enter 1st \n number \n here."}
placeholderTextColor = '#66FCF1'
keyboardType = 'number-pad'
multiline = {true}
returnKeyType = {"next"}
onSubmitEditing={ this.secondInput.focus()}> //* This will shift the focus to the next textinput *
</TextInput>
{/****** TEXT INPUT 2 ******/}
<TextInput style={styles.textInput2}
placeholder = {" Enter 2nd \n number \n here."}
placeholderTextColor ='#EDF5E1'
keyboardType = 'number-pad'
multiline = {true}
onSubmitEditing={ Keyboard.dismiss }> //* This will dismiss the keyboard once user submitted *
</TextInput>
</View>
I have 2 TextInputs in my code and it when the user enters the value on textinput1 the focus will be shifted to textinput2. I checked some questions here and answers and this is the closest and easiest path I saw to slowly grasp the basics of react native.
onSubmitEditing={() =>{this.secondTextInput.focus(); }}
but I noticed that my secondInput doesn't have an id not a name to call. How do I do this? I checked the documentation online of textinput it does not contain any id not a name. I would be so glad if you can help me on this one. Thanks!