React - My form is submitting empty data because 'e' and 'data' are declared but never used?
- 阅读更多 关于 React - My form is submitting empty data because 'e' and 'data' are declared but never used?
问题 I'm trying to implement a form using react-hook-form. I'm not able to actually connect the data and event working correctly. As the docs state, I'm using the handleSubmit function from the react-hook-form library, with my custom Axios post as the onSubmit parameter: onSubmit={handleSubmit(onSubmit) According to my Vscode, the data and event are not registering correctly const onSubmit = (data, e) => {} . When the form is submitted, the web console logs an empty form: {email: "", password: ""}