Open utterances-bot opened 2 years ago
In this tutorial I'll show you how you can make a generic React hook to handle form validation.
https://dimitr.im/form-validation-react-hooks
You should use previousState in your setState instead of using the current values
previousState
setValues(prevState => {...prevState, [event.target.name]: event.target.value})
Thanks a ton! Super helpful tutorial :)
Form validation using React hooks | Dimitri's tutorials
In this tutorial I'll show you how you can make a generic React hook to handle form validation.
https://dimitr.im/form-validation-react-hooks