Add optional form persistence hook (useFormPersist
)
#13097
Unanswered
mahmoud-alaa1
asked this question in
Ideas
Replies: 0 comments
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
File
objects or raw passwords.Beta Was this translation helpful? Give feedback.
All reactions