react icon indicating copy to clipboard operation
react copied to clipboard

[DevTools Bug] Children cannot be added or removed during a reorder operation.

Open HamaydaGabsi opened this issue 1 year ago • 1 comments

Website or app

https://github.com/HamaydaGabsi/Color-Project

Repro steps

  1. Select a palette
  2. Select to color to view shades
  3. Go back to the colors with the navigation arrow

How often does this bug happen?

Every time

DevTools package (automated)

react-devtools-extensions

DevTools version (automated)

4.25.0-336ac8ceb

Error message (automated)

Children cannot be added or removed during a reorder operation.

Error call stack (automated)

at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26848:41
    at bridge_Bridge.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24626:22)
    at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:24795:14
    at listener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:54959:39)

Error component stack (automated)

No response

GitHub query string (automated)

https://api.github.com/search/issues?q=Children cannot be added or removed during a reorder operation. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react

HamaydaGabsi avatar Jul 29 '22 12:07 HamaydaGabsi

Hey! I tried to test out your project, but I only see the create react app logo. image

could you upload a version of your app on github or codesandbox so we can debug further? Thanks!

lunaruan avatar Jul 29 '22 16:07 lunaruan

Is your app something that resembles this? https://reactjsexample.com/create-a-make-your-own-color-palette-app-using-react-framework/ --->github: https://github.com/Colt/react-colors

hanswang123456 avatar Aug 06 '22 01:08 hanswang123456

I've runned into the same issue recently and mine was caused by duplicate keys when mapping a list of items into renders function. Fixed the issue by update keys to use unique identifier.

j56xie avatar Sep 14 '22 17:09 j56xie

Just had this pop on our codebase while refactoring some old code. This seems to be an issue with rendering sub-components with duplicate keys in the devtools. I've uploaded an MRE here: https://github.com/MidnightTinge/gh-react-25007

The way to trigger the error is to flip the <Item/> component's key prop value from key to value. This should trigger the error, and the button on the page automates this process.

After re-reading I realized my naming was probably confusing. To trigger the specific error, the keys need to go from duplicate to non-duplicate while the devtools are open.

MidnightTinge avatar Sep 21 '22 22:09 MidnightTinge

I had the same issue and it was because I had multiple list item with the same key value, so during the update it was behaving incorrectly and throwing this error.

hrasekh avatar Jan 03 '23 18:01 hrasekh

I also had the same issue i fixed it by giving unique id to key .

navneetMukrah avatar Apr 15 '23 17:04 navneetMukrah

unique id is the solution, just fix mine now

ChichebeDarlington avatar Jun 02 '23 17:06 ChichebeDarlington

I've runned into the same issue recently and mine was caused by duplicate keys when mapping a list of items into renders function. Fixed the issue by update keys to use unique identifier. This is the solution

HamaydaGabsi avatar Jun 03 '23 03:06 HamaydaGabsi

not having duplicate keys is react 101 (and an easy mistake to make, I still oppsie that one myself sometimes while prototyping 😁) so while it may mask the underlying issue, this is technically not resolved until devtools specifically don't report it as a problem. this doesn't appear to be anywhere on the team's radar, but the ticket should probably stay open until that happens

MidnightTinge avatar Jun 03 '23 03:06 MidnightTinge