This is an ideal methodology question. I am new to react-native and I am developing an app in which I am asking people to enter the list of cars they own.
When they arrive at the app screen, they see the fields to enter one car's information.
But when they press the 'Add car' button below the above input fields, on the same page, they should be able to see one more set of fields to add information about another car.
What is the ideal way to do this,
I have done following,
- I have one set of car information fields displayed by default in render function
- After that, I have an 'add car' touchable highlight
- When the touchable highlight is clicked, a function is called that returns , new set of fields to be added (Textinput>, etc. )
How do I add the information returned on the page? Should I update a state variable that will be "" at the start and will contain "Textinput etc." later?