Skip to content

Why can't we use ref for initialValues in the useForm composable? #4955

Closed Answered by logaretm
Us3r-gitHub asked this question in Q&A
Discussion options

You must be logged in to vote

Because it brings with it a set of expectations, like what happens when that ref changes? We can update the values then, but what if the user already interacted with the form and changed the values?

So in order to avoid introducing foot guns and satisfying one use-case over the other, it is recommended that you be explicit and use resetForm when you want the changes to reflect.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Us3r-gitHub
Comment options

@logaretm
Comment options

Answer selected by Us3r-gitHub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants