DEV Community

Discussion on: Handling Forms in ReactJS the right way

Collapse
 
evanwinter profile image
Evan Winter

Nice – a couple things I had to tweak to get working, though:

  • <input /> elements need names like name="username", otherwise the change handler doesn't know which state value to update
  • const handleChange(e){} needs to either be const handleChange = (e) => {} or function handleChange(e){}
Collapse
 
fazer1929 profile image
Abhishek Agrawal

Thanks for pointing it out