Getting "flattenChildren" error when upgrading from 2.0.7 to 2.1.2
See original GitHub issueHi, 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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top 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 >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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jktravis I fixed the issue. Sorry for the inconvenience!
OMG forgot to remove the context menu from the container when it’s unmounted