I am a newbie. Im building a web application with React. I have a form with 18 fields.
I currently have a useState with initial value
const clientObj = { //18 fields };
const [client, setClient] = useState(clientObj);
For each input, I have something like this (example with field name):
<Form.Group>
<Form.Control
onChange={ e => { setClient( prev => ({...prev, name:e.target.value}))}}
placeholder="Your name"
type="text"
required/>
</Form.Group>
It works, however I doubt it is efficient. I want my web application to work efficiently. How should I handle a form with so many fields? Thanks :)