How to get input text • React Native
In this article we will see how to get the user input text inside the <TextInput>, very simply.
In this example, we will be using a login page :
Add the reference for each TextInput at the top of your login class, inside the constructor :
Then, put the ref tag inside the each TextInput.
Attribute this ref tag to each variable that have been referenced. Here is the example with this.logInput :
Now you can get the value by using this.logInput.current._lastNativeText inside our code.