question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select does not work if two elements has the same value (but different keys)

See original GitHub issue

What do you expected?

Works without error

What happen?

Error: flattenChildren(...): Encountered two children with the same key, .$590. Child keys must be unique; when two children share a key, only the first child will be used

Re-producible online demo

http://codepen.io/anon/pen/XMpGvY?editors=001

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
yesmeckcommented, Mar 9, 2017

value is used as key in Select, so please keep value unique.

1reaction
mimol91commented, Mar 9, 2017

I cant. In example above two different countries have the same prefix. Can it be solved somehow? Or I need to do some dirty hack?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Two children with the same key" error when trying to populate ...
I am trying to create a multi-select dropdown using Semantic UI and React that dynamically fetches data from an API. It successfully manages...
Read more >
Encountered Two Children with the Same Key — React Fix
The Problem When you are rendering React components in a map function inside ... So two completely different objects will have the same...
Read more >
<select>: The HTML Select element - HTML - MDN Web Docs
Selecting multiple options · Focusing on the <select> element (e.g. using Tab ). · Holding down the Ctrl key then using the Up...
Read more >
Creating a condition with multiple keys or values
If a single condition operator includes multiple values for one key, that condition operator is evaluated using a logical OR . All conditions...
Read more >
Select layers and objects – Figma Help Center
Select multiple layers. You can also select more than one object or layer at a time. This is great when you want to:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found