dillon1000/react

Commit

Explicit and Implicit Keys Need Separate Namespaces

There are certain cases where you can end up with a collision with an implicit
key (array index) if your explicit key prop is a number. They should use
different namespaces. Therefore I wrap explicit keys in curlies and implicit
array indices in brackets.

I added a simple test case, but another case came up on the mailing list. Where
undefined entries in an array actually results in an entry and therefore an
implicit key.
Browse files
Changed paths6 files
First-parent comparison
M src/core/ReactComponent.js ModifiedM src/core/__tests__/ReactIdentity-test.js ModifiedM src/utils/__tests__/ReactChildren-test.js ModifiedM src/utils/__tests__/sliceChildren-test.js ModifiedM src/utils/__tests__/traverseAllChildren-test.js ModifiedM src/utils/traverseAllChildren.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…