A technique that allow JavaScript function to handle submission and access the data from user input.
updating the state with users responses as soon as they enter them is better because this allow to instantly which is faster and prevent lagging and probably problems especially for component’s that’s depends on it.
By using event.target.name.
Using a conditional, like an if statement, allows us to specify that a certain block of code should be executed if a certain condition is met.
While we can show same results in more simple and shorter way using The Conditional (Ternary) Operator Explained.
Example using (if):
if ( condition ) { value if true; } else { value if false; }
Ex: using Ternary:
condition ? value if true : value if false
if(x===y){ console.log(true); } else { console.log(false); }
ternary statement:
x===y? console.log(true) : console.log(false)
to know more about forms and how to use it widely in react and make multiform and design a best UI and UX.