Combine Material UI and React Hook Form
- typescript support
- native support with material-ui & react-hook-form
- extend material-ui components
- provide uncontrolled & controlled components
npm install mui-easy-form
yarn add mui-easy-form
pnpm install mui-easy-form
import { Button } from '@mui/material'
type User = {
id: string
name: {
first: string
last: string
}
}
function App() {
const { handleSubmit, control } = useForm<User>()
return (
<form
noValidate
onSubmit={handleSubmit((data) => {
console.log(data)
})}
>
<TextField<Shape>
control={control}
label="text"
required
name="name.first"
/>
<Button type="submit">submit</Button>
</form>
)
}
- [x] word
- [x] password
- [x] number
- [ ] codesandbox
- [ ] i18n
- [ ] reduce size
- [ ] FAQ: "XXIO" difference with "XXField"?
- [ ] eslint