Skip to content

Commit ab46b92

Browse files
committed
update reset doc
1 parent dc6d594 commit ab46b92

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/content/docs/useform/reset.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ Reset the entire form state, fields reference, and subscriptions. There are opti
4040
})
4141
}, [isSubmitSuccessful])
4242
```
43+
- It's fine to run reset without argument as long as you have provided a `defaultValues` at useForm.
44+
45+
```
46+
reset(); // update form back to default values
47+
48+
reset({ test: 'test' }); // update your defaultValues && form values
49+
50+
reset(undefined, { keepDirtyValues: true }); // reset other form state but keep defaultValues and form values
51+
```
4352

4453
</Admonition>
4554

0 commit comments

Comments
 (0)