-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix NODE_TO_KEY correction for split_node and merge_node #4901
Conversation
🦋 Changeset detectedLatest commit: c242b0a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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! I’d love to see a test for this though I know that’s not easy yet. Please add a changeset when you get a chance.
@dylans yeah a test here would be nice indeed, will see what I can do. For a test I'd have to check whether a component remounted or not, I don't think cypress can do that. Or can go more basic and test the |
@bryanph don't know about cypress, but here's a react test renderer version that fails against previous version but works with the PR:
|
@nemanja-tosic awesome, thanks! I pushed two tests for the particular cases being fixed here based on your example here. Let me know if there's something else I can assert here. |
266efbb
to
c242b0a
Compare
…lor#4901) * Fix NODE_TO_KEY correction for split_node and merge_node * fix lint * add changeset * Add NODE_TO_KEY tests for number of mounts for split_node and merge_node
Description
Fixes #4900
Issue
Fixes: #4900
Example
The logic in
with-react
was not resetting the node keys for the right nodes forsplit_node
andmerge_node
operations. This fixes that so that onsplit_node
the node being split does not get remounted and onmerge_node
the node being merged into also does not get remounted.Context
See #4900
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)