Closed
Description
What happened
Updated a Repo to React 16 and discovered that iterating over a Map will render the return item && the key. I realize using Maps as children is experimental but thought you'd like to know. Not sure if this would be considered a react 16 bug.
What I expected:
Render the React element and ignore the key.
How to reproduce
type ItemMap = Map<*, *>;
const itemMap: ItemMap = Map({
0: 'zero',
1: 'one',
2: 'two',
});
{itemMap.map((item, index) => (
<Item key={index} item={item} />
)}
will render something like 0 <Item /> 1 <Item /> 3 <Item />
Metadata
Metadata
Assignees
Labels
No labels