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
Breaking change between 7.22.4
& 7.22.5
#9524
Comments
Thanks for the issue report, however, please refer to the doc |
@bluebill1049 how do you suggest to remove a value from form values? |
Btw, the breaking change was introduced in this set of changes and in this file |
I hope you do reconsider, as suggesting users-developers to patch on their side for conversion (ex. |
If an input is removed or unmounted, then it should use |
The input exists, the value is removed from a form.
context.unregister(name)
context.register(name) Do you really think this is a good DX for a developer to remove a value from a form? |
The really bad part here is:
So many other devs would stumble on this error |
It's a valid point above, I will tighten up the type. Everything else will stay the same. |
So there will be no way to remove a value. I hope you will reconsider, as many developers looking at this issue would probably lose trust in this library to be safe long-term, especially with breaking changes in patch versions. |
Even if you change typings, it won’t help devs in all cases, as
The only safe way to handle this is to actually handle |
Version Number
7.22.5
Codesandbox/Expo snack
https://codesandbox.io/s/sharp-margulis-wf7myr
Steps to reproduce
7.22.5
Set name to undefined
FieldController
doesn't get an value update (no console)Go back to step 2, use version
7.22.4
, repeat steps, and see that it correctly updates the value toundefined
and triggers an update (console statement is invoked)Expected behaviour
setValue
toundefined
triggers an update and does update the value toundefined
(currently it doesn't)What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: