T
TanStack4mo ago
frozen-sapphire

isDefaultValue

I know we can get the isDefaultValue from the form state, but I don't see anywhere that says if this gets updated to true after a form is submitted successfully. Does it reset this flag? Or is there another way to essentially reset if this form is changed or not after submitting essentially setting the submitted data as the new form defaults?
4 Replies
flat-fuchsia
flat-fuchsia4mo ago
the form isn't reset after submission by default. You have to call form.reset(newValues?) for that omitting newValues depending on if you have new values or not
frozen-sapphire
frozen-sapphireOP4mo ago
Got it, that makes sense. I saw that in another thread after posting this, but thought I'd leave it just incase that wasn't the answer still.
flat-fuchsia
flat-fuchsia4mo ago
where did you try and look for it in the documentation? I'll probably add it to the Submission Handling section, but let me know if you think there's a better spot
frozen-sapphire
frozen-sapphireOP4mo ago
@Luca | LeCarbonator I did a search for "isDefaultValue" and really all that shows is the Basic Concepts section and the DerivedFormState type which doesn't give a lot of information either. I think Submission Handling would be a good section. Add it as a note on how to reset the isDefaultValue for the form.

Did you find this page helpful?