I have been trying to create and submit a basic React Native form without any library. Currently, for testing purposes, I have included only 3 TextInput
(s) only.
As soon as the form is submitted only the values of the last TextInput
, password
here, is shown updated in the state object (in the console). The first two TextInput
fields values remain empty as the initial state.
I tried lots of patterns to pass the data from the input fields using the method onChangeText()
, but nothing seems to work for me. No matter how many input fields, only the last input field's state is available in the console. Not sure where things are going wrong. Here is the snack expo link to reciprocate the issue:
https://snack.expo.io/0DP-pi6bn
This might be a silly issue that I am unable to figure out, but any help to resolve the same, will be highly appreciated.
Thanks