useForm()
, which is given a
form schema.

Example: Simple Form
simple-form.tsx
- Create a form schema
- Destructure the form components you need from
useForm()
- Wrap your form inputs in the
<Form/>
tag - Define your
onSubmit
function in<Form/>
Example: Complex Validation
Sometimes you may need to add more complex validation than a static schema can express. For example, you might want to ensure that the minimum value is less than the maximum value. You can achieve this by passing a validation function touseForm()
.
complex-validation.tsx