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.

Getting "flattenChildren" error when upgrading from 2.0.7 to 2.1.2

See original GitHub issue

Hi, Any idea why I would just start getting the flattenChildren(...): Encountered two children with the same key, 'journal-menu'. error after upgrading from 2.0.7 => 2.1.2?

As far as I can tell, there’s no iteration or lists of components going on where I’m using it except for where I’m using the ContextMenuProfider.

const JournalListItem = ({item}) => {
  const journalId = item.get('Id');
  return (
    <li data-id={journalId}>
      <ContextMenuProvider id="journal-menu">
        <Link to={`/journal/${journalId}`}>{item.get('Name')}</Link>
      </ContextMenuProvider>
    </li>
  );
};

Here’s the whole message:

Warning: flattenChildren(...): Encountered two children with the same key, `journal-menu`. Child keys must be unique; when two children share a key, only the first child will be used.
    in div (created by ProxyContainer)
    in ProxyContainer

It looks like there was a ProxyContainer recently added. Could this be it adding duplicate keys, or am I just using it wrong now?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fkhadracommented, Sep 6, 2017

@jktravis I fixed the issue. Sorry for the inconvenience!

0reactions
fkhadracommented, Sep 6, 2017

OMG forgot to remove the context menu from the container when it’s unmounted

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Warning: flattenChildren(...): Encountered two children ...
I have replicated my code below, but for some reason CodePen is not showing the error. var FilterOptions = React.createClass({ changeOption: ...
Read more >
botpress-messenger - UNPKG
The CDN for botpress-messenger.
Read more >
yarn.lock · lingohub_language_update_2022-04-11Z · RocketChat ...
json5 "^2.1.2". 69. semver "^6.3.0". 70. source-map "^0.5.0". 71. 72. "@babel/eslint-parser@^7.16.5": 73. version "7.16.5".
Read more >
https://patch-diff.githubusercontent.com/raw/no2aw...
This can happen in a test environment if a component schedules an update from ... props); + var content = flattenChildren(props.children); + +...
Read more >
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag ...
I'm getting an error when running npm install: Invalid tag name ">=^16.0.0": Tags may not have any characters that encodeURIComponent encodes. @tokomeno-kaltura ...
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