Skip to content

[DevTools Bug]: Children list grows indefinitely when adding/removing useEffect #21469

@eps1lon

Description

@eps1lon

Website or app

Please checkout the linked branch not main
https://github.com/eps1lon/react-devtools-repro-no-matching-node/tree/repro/elements-leaking
Repro steps and screen recording included in the repro

Repro steps

  1. Clone repro
  2. yarn
  3. yarn start
  4. Open app page
  5. open devtools
  6. Uncomment the useEffect block i.e. add an effect
  7. inspect Component element
  8. comment useEffect block i.e. remove the effect
  9. Repeat comment/uncomment to see that children grow indefinitely

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

Could not inspect element with id 4

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

Might be a duplicate of #21436 (comment) since the repro steps are the same. But depending on what the effect is doing, the behavior is different.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions