Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/content/ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export default function App() {

return (
<form onSubmit={handleSubmit(onSubmit, onError)}>
<input {...(register("firstName"), { required: true })} />
<input {...(register("lastName"), { minLength: 2 })} />
<input {...register("firstName", { required: true })} />
<input {...register("lastName", { minLength: 2 })} />
<input type="email" {...register("email")} />

<input type="submit" />
Expand Down Expand Up @@ -547,7 +547,7 @@ export type FormStateProxy<TFieldValues extends FieldValues = FieldValues> = {

```tsx copy sandbox="https://codesandbox.io/s/react-hook-form-nestedvalue-lskdv"
import { useForm, NestedValue } from "react-hook-form"
import { Autocomplete, TextField, Select } from "@material-ui/core"
import { TextField, Select } from "@material-ui/core"
import { Autocomplete } from "@material-ui/lab"

type Option = {
Expand Down Expand Up @@ -602,7 +602,7 @@ export default function App() {

<Select
value=""
onChange={(e) => setValue("muiSelect", e.target.value as number[])}
onChange={(e) => setValue("select", e.target.value as number[])}
>
<MenuItem value={10}>Ten</MenuItem>
<MenuItem value={20}>Twenty</MenuItem>
Expand Down