Skip to content

Commit 7a89e12

Browse files
committed
set error in field
1 parent 0c7d07e commit 7a89e12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/ts.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ export default function App() {
103103

104104
return (
105105
<form onSubmit={handleSubmit(onSubmit, onError)}>
106-
<input {...register("firstName")} />
107-
<input {...register("lastName")} />
106+
<input {...register("firstName"), { required: true }} />
107+
<input {...register("lastName"), { minLength: 2 }} />
108108
<input type="email" {...register("email")} />
109109

110110
<input type="submit" />

0 commit comments

Comments
 (0)