Skip to content

Commit a8fad1a

Browse files
authored
docs: fix incorrect code examples in TypeScript support documentation (#1175)
1 parent 521e746 commit a8fad1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/ts.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export default function App() {
101101

102102
return (
103103
<form onSubmit={handleSubmit(onSubmit, onError)}>
104-
<input {...(register("firstName"), { required: true })} />
105-
<input {...(register("lastName"), { minLength: 2 })} />
104+
<input {...register("firstName", { required: true })} />
105+
<input {...register("lastName", { minLength: 2 })} />
106106
<input type="email" {...register("email")} />
107107

108108
<input type="submit" />
@@ -547,7 +547,7 @@ export type FormStateProxy<TFieldValues extends FieldValues = FieldValues> = {
547547
548548
```tsx copy sandbox="https://codesandbox.io/s/react-hook-form-nestedvalue-lskdv"
549549
import { useForm, NestedValue } from "react-hook-form"
550-
import { Autocomplete, TextField, Select } from "@material-ui/core"
550+
import { TextField, Select } from "@material-ui/core"
551551
import { Autocomplete } from "@material-ui/lab"
552552

553553
type Option = {
@@ -602,7 +602,7 @@ export default function App() {
602602

603603
<Select
604604
value=""
605-
onChange={(e) => setValue("muiSelect", e.target.value as number[])}
605+
onChange={(e) => setValue("select", e.target.value as number[])}
606606
>
607607
<MenuItem value={10}>Ten</MenuItem>
608608
<MenuItem value={20}>Twenty</MenuItem>

0 commit comments

Comments
 (0)