T
TanStack3mo ago
continuing-cyan

Reset isDefaultValue

Hi! Is there a way to say that the current form state is the new DefaultValue? I need it because when I submit a form I want it to reset.
5 Replies
flat-fuchsia
flat-fuchsia3mo ago
you can pass values to the reset method those will be used as the new defaultValues
eastern-cyan
eastern-cyan3mo ago
reset(values?, opts?): void Resets the form state to the default values. If values are provided, the form will be reset to those values instead and the default values will be updated. https://tanstack.com/form/latest/docs/reference/classes/formapi#reset
continuing-cyan
continuing-cyanOP3mo ago
Ah great, thank you.
extended-salmon
extended-salmon3mo ago
are you living in react land, or the others ones?
flat-fuchsia
flat-fuchsia3mo ago
vue if I remember correctly

Did you find this page helpful?