This repository was archived by the owner on Jul 23, 2021. It is now read-only.
This repository was archived by the owner on Jul 23, 2021. It is now read-only.
[4.0.0.rc-9] Immutable renders a Map's key in React 16 #55
Open
Description
From @athomann on Mon, 30 Oct 2017 16:32:48 GMT
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 />
Copied from original issue: immutable-js#1430