-
Notifications
You must be signed in to change notification settings - Fork 50.1k
Closed
Milestone
Description
In 0.11, the code
<div>
<div key={null}>foo</div>
<div key={null}>bar</div>
</div>
assigned implicit keys to both children. In 0.12, it gives the error
Warning: flattenChildren(...): Encountered two children with the same key,
.$null. Child keys must be unique; when two children share a key, only the first child will be used.
and renders only "foo", because the key is cast to a string in ReactElement
react/src/core/ReactElement.js
Line 140 in be468c2
| key = config.key === undefined ? null : '' + config.key; |
before it gets checked against null in traverseAllChildren:
react/src/utils/traverseAllChildren.js
Line 50 in be468c2
| if (component && component.key != null) { |
I guess it's okay if this is intentional but it broke a part of KA in the upgrade.
@sebmarkbage? (cc @jdan)
Metadata
Metadata
Assignees
Labels
No labels