T
TanStack6mo ago
rival-black

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
extended-salmon
extended-salmon6mo ago
you can pass values to the reset method those will be used as the new defaultValues
itchy-amethyst
itchy-amethyst6mo 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
rival-black
rival-blackOP6mo ago
Ah great, thank you.
continuing-cyan
continuing-cyan6mo ago
are you living in react land, or the others ones?
extended-salmon
extended-salmon6mo ago
vue if I remember correctly

Did you find this page helpful?