remix-hook-form
remix-hook-form copied to clipboard
Automatically reset form on valid submission / loader revalidation
trafficstars
I tried overriding the submitHandlers, but this stops submission entirely (no way to call the default plugin handler) - kind of lost here.
I don't redirect after an action, so I assumed this should be support (conform works with it, but has other bigger issues)...
Maybe related to #148
of course, smth like this could work:
useEffect(() => form.reset(loaderData), [form.reset, loaderData])
but that's ugly. nobody wants useEffect in their codebase 😄
I mean the useEffect would just get moved to this lib instead, what would be the expected API for this, a config options like: { removeOnSubmit: true } ?