dillon1000/react

Commit

Fixing known keying problems

This fixes the last known parts of the flattening experiment. This has grown to
be somewhat complex and potentially fragile because of it. We may end up
reverting flattening in the future or address it slightly differently.

The purpose of this diff is to test if we've finally understood the real world
edge cases that flattening can lead to and how we have to key components to
cover those cases.

With this commit we never rekey the internal _key property. The semantics is
that once a component passes through a composite component, it's identity is
frozen.

props.key should accept numeric values and booleans which includes 0 and false.
This fixes the truthiness check.

We should never warn about missing key properties if a component is passed as a
static child. The _key acts as a flag to determine whether this component
was checked already.
Browse files
Changed paths6 files
First-parent comparison
M src/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/ReactCurrentOwner.js ModifiedM src/core/__tests__/ReactComponentFlattenChildren-test.js ModifiedM src/core/__tests__/ReactIdentity-test.js ModifiedM src/utils/__tests__/mapChildren-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…