Silent resetForm #3044
Unanswered
ericchernuka
asked this question in
Ideas
Replies: 1 comment
-
After thinking about this for more than 5 minutes, the better solution was to create a ResetButton component that handled the workflow instead of using the Formik onReset prop.
|
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
-
I have a use case where we use React Router to use the
<Prompt />
when the form is dirty. The issue we've run into is we want to reset the form on successful save to allow navigation away from the form, but we also utilize theonReset
callback on<Formik />
for allowing the user to toss their changes. I wonder if adding asilent
argument to theresetForm
method would allow for programatic form resets without the callback being invoked?Seems pretty trivial to implement, but thought I'd pose it before doing a PR.
Beta Was this translation helpful? Give feedback.
All reactions