DEV Community

Discussion on: I was creating Forms the wrong way all along in React.js 🤔

Collapse
 
noriller profile image
Bruno Noriller

Not sure you've used this, but you can control them all in a single state with something like this:

handleChange = (e) => {
  setState((old) => ({...old, [e.target.name]: e.target.value}))
}
Enter fullscreen mode Exit fullscreen mode