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.

version 4.0.0 + grouped options = console error: "Warning: Encountered two children with the same key, `react-select-2-option-0-[object Object]"

See original GitHub issue

in 4.0.0 version when we click on select component to open it we get:

Warning: Encountered two children with the same key, `react-select-2-option-0-[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
    in div (created by Group)
    in div (created by EmotionCssPropInternal)
    in EmotionCssPropInternal (created by Group)
    in Group (created by Select)
    in div (created by EmotionCssPropInternal)
    in EmotionCssPropInternal (created by MenuList)
    in MenuList (created by ScrollManager)
    in ScrollManager (created by MenuPlacer)
    in div (created by EmotionCssPropInternal)
    in EmotionCssPropInternal (created by Menu)
    in Menu (created by MenuPlacer)
    in MenuPlacer (created by Select)
    in div (created by EmotionCssPropInternal)
    in EmotionCssPropInternal (created by SelectContainer)
    in SelectContainer (created by Select)
    in Select (created by StateManager)
    in StateManager
    in Unknown

we can see it here (link from page - grouped example) https://codesandbox.io/s/7utj1?module=/example

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
mrudowskicommented, Jan 22, 2021

You are really great people, all of you. I admire all the work behind this fine component back from v1

1reaction
Methuselah96commented, Jan 22, 2021

@mrudowski Should be resolved now in 4.0.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Encountered Two Children with the Same Key — React Fix
The Problem When you are rendering React components in a map function inside the render function, you must provide a key prop to...
Read more >
Two children with the same key in React - Stack Overflow
Closed 4 years ago. Application works, my classes really adds a new element but I see below warning in console! Warning: Encountered two...
Read more >
Encountered two children with the same key (React)
The React error "Encountered two children with the same key" occurs when two or more of the elements we return from the map()...
Read more >
Fix for Warning: Encountered two children with the same key ...
Set a key for each MultiValue, React.cloneElement(child, { key: child.props.children }) this works if the labels for your options are unique. If ...
Read more >
Encountered two children with the same key, Keys ... - YouTube
How to solve Warning : Encountered two children with the same key, Keys should be unique so that components maintain their identity across ......
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