How to make a generic handleInputChange method on all of your inputs

You can do it by assigning a name for your input and by using square brackets inside your onChange method:

The square brackets allow you to access the value of the name property.
A little a bit more concise way of writing the same method using destructuring

Now add names for all of our inputs:

Happy coding!

Leave a comment