Skip to content
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
Methuselah96 opened this issue Oct 17, 2020 · 1 comment
Open

[4.0.0.rc-9] Immutable renders a Map's key in React 16 #55

Methuselah96 opened this issue Oct 17, 2020 · 1 comment

Comments

@Methuselah96
Copy link

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

@Methuselah96
Copy link
Author

Doesn't sound like an immutable@4 regression.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant