-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Conversation
This would be nice! Any ideas when this would be merged? |
There was a problem hiding this 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?
a functionality like this would be pretty helpful. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 5a66fd2. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
==========================================
- Coverage 91.55% 88.45% -3.10%
==========================================
Files 21 26 +5
Lines 900 1083 +183
Branches 206 269 +63
==========================================
+ Hits 824 958 +134
- Misses 71 116 +45
- Partials 5 9 +4 ☔ View full report in Codecov by Sentry. |
#785