-
-
Notifications
You must be signed in to change notification settings - Fork 493
fix: stabilize useField public handler identity #931
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
Merged
erikras
merged 1 commit into
final-form:main
from
kapral18:fix/stabilize-usefield-public-handler-identities
Jul 22, 2021
Merged
fix: stabilize useField public handler identity #931
erikras
merged 1 commit into
final-form:main
from
kapral18:fix/stabilize-usefield-public-handler-identities
Jul 22, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 057c7a2:
|
BREAKING: onBlur, onChange, onFocus handlers no longer change identity if props or internal state is changed, thus on consumer side the behavior relying on handler identity can break Closes #816
Published in v6.5.4.
@github-actions
github-actions
bot
locked as resolved and limited conversation to collaborators
Sep 29, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
useFieldpublic handlers likeonFocus,onChange,onBlurare changing their identities based on various internal variables and externally available props/(config parts) likevalue,name,parseetc...I am suggesting that public handlers should not be subject to identity change at all, so that consumers can rely on those without jumping through hoops with
useRefas in https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often.As a consequence after this change consumer code relying on this behavior might break, hence this is a BREAKING CHANGE
Closes #816