Skip to content

fix: Colliding keys of flex children wrapped in fragments - #652

Draft
MatiPl01 wants to merge 2 commits into
mainfrom
fix/flex-child-keys
Draft

MatiPl01 wants to merge 2 commits into
mainfrom
fix/flex-child-keys

Conversation

@MatiPl01

Copy link
Copy Markdown
Owner

Description

Children of a fragment get keys that are unique only within that fragment, so they could collide with the keys of children outside of it (unkeyed children next to a fragment, or the same key used in two fragments). One of the colliding items then disappeared and another one was rendered twice.

Keys of fragment children are now prefixed with the key of the fragment. This changes the keys of such children reported in callbacks (for example .$a becomes .1:.$a); keys of children that are not in a fragment stay the same.

Testing

New jest test, fails on main.

Evidence
Test on main before-test-on-main.txt
Test with the fix after-test-with-fix.txt

@MatiPl01 MatiPl01 self-assigned this Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
react-native-sortables-docs Ignored Ignored Preview Nov 26, 2026 1:52pm UTC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant