Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added ability to specify values for form.reset method #791

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vara855
Copy link

@vara855 vara855 commented Jun 28, 2024

@thomasvt1
Copy link

This would be nice!

Any ideas when this would be merged?

Copy link
Member

@Balastrong Balastrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, looks like a great starting point!
Let me add a thought, this seems to me more like a setAll than a proper reset, which I would expect also setting the new default values.

Doing this (in two separate moments):

reset({ firstName: "foo" }) // Passing an object - set the new default
reset() // No parameters - reset to default

Should end up with the form this the state { firstName: "foo" }.
At least as a default behaviour, then nothing stops us from adding an extra parameter with a flags, similar to RHF, to control that.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants