Add optional form persistence hook (useFormPersist)
#13097
Unanswered
mahmoud-alaa1
asked this question in
Ideas
Replies: 2 comments 1 reply
-
|
Like this:
Will be cool to have it directly here for sure |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
you don't have to use watch to persist values use resolver alternative: To cut sensitive stuff: To keep standard schema resolver: I don't remember if this is mentioned somewhere in the docs, but it is the best way to manage any custom functionality (values persist, warning level validation) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Many developers need to persist form state across page reloads or app restarts to improve user experience, especially for long forms on web and mobile.
Currently, developers must manually integrate
watch()+localStorage(or AsyncStorage on React Native) and handle exclusions, debounce, and type-safe storage themselves.This can lead to duplicate code and potential bugs/security issues if passwords or files are accidentally persisted.
I would like to introduce an optional persistence hook for React Hook Form, e.g.
useFormPersist(form, key, options), which:reset()when the form mounts.Example usage:
Suggested Design
Fileobjects or raw passwords.Beta Was this translation helpful? Give feedback.
All reactions