Skip to content

Commit

Permalink
📚 simplify quickstart example
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Sep 9, 2022
1 parent 1f2e788 commit a9c8d28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ function App() {
handleSubmit,
formState: { errors },
} = useForm();
const onSubmit = (data) => console.log(data);

return (
<form onSubmit={handleSubmit(onSubmit)}>
<form onSubmit={handleSubmit(data => console.log(data))}>
<input {...register('firstName')} />
<input {...register('lastName', { required: true })} />
{errors.lastName && <p>Last name is required.</p>}
Expand Down

0 comments on commit a9c8d28

Please sign in to comment.