Click here to Skip to main content
15,867,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I have general question regarding react js. I am very new in react and working on one PoC. General approach in react is create a state object for input controls and assign its state value to that input before submitting. This will work fine when we have 2-5 controls on page. Now issue I have is, I have 20 diff types of input present on page like textboxes, dropdowns, calender and radio button. My concern is do I need to create 20 properties in state object. Do I need to write 20 diff types of onChange funcion for controls. This is will my code too much lenghty. Kindly help.

What I have tried:

I am trying to find a way how can I do it without creating 20 properties and diff onChange() for each control.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900