T
TanStack3w ago
adverse-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
optimistic-gold
optimistic-gold3w 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
adverse-sapphire
adverse-sapphireOP3w 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.
optimistic-gold
optimistic-gold3w 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
adverse-sapphire
adverse-sapphireOP3w 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?