Skip to content

[DevTools] Fix crash when revealing stable, filtered <Activity> children#493

Closed
everettbu wants to merge 2 commits into
mainfrom
sebbie/reveal-activity
Closed

[DevTools] Fix crash when revealing stable, filtered <Activity> children#493
everettbu wants to merge 2 commits into
mainfrom
sebbie/reveal-activity

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35734
Original author: eps1lon


Summary

This aligns the hidden -> visible Activity path with how we treat hidden Activity. Since we don't mount hidden Activity children, we need to switch to the mount path when updating an Activity from hidden to visible.

This mostly went unnoticed since the update that reveals Activity also created fresh children. But for children from props, we continue down the update path and then later crash because children unexpectedly changed.

Originally I added an extra isReconnectingSubtree before realizing the whole transition from hidden to visible wasn't correctly modelled.

How did you test this change?

  • Added test
  • https://flvrxf.csb.app/ no longer crashes (used to crash with The children should not have changed if we pass in the same set.)

@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 9, 2026
@greptile-apps

greptile-apps Bot commented Feb 9, 2026

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR fixes a DevTools backend reconciliation bug when an Offscreen/Activity boundary transitions from mode="hidden" to mode="visible".

Previously, hidden Activity children were not mounted (and were unmounted when hiding), but the hidden→visible transition could still go through the update/reconcile path. When component filters caused the apparent child set to differ (e.g. filtered wrappers around stable children), this led to an invariant crash ("The children should not have changed if we pass in the same set.").

The change introduces a dedicated branch for prevWasHidden && !nextIsHidden that mounts the next child set and marks the subtree for child-order reset, mirroring the existing mount behavior used for other visibility transitions. A regression test covers the scenario with stable children from props and a filtered wrapper component.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • The change is small and localized to the Offscreen/Activity reconciliation logic, aligns with the existing mount/unmount semantics for hidden subtrees, and includes a targeted regression test that previously triggered a deterministic crash.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react-devtools-shared/src/backend/fiber/renderer.js Fixes Offscreen (Activity) hidden→visible transition by mounting children instead of attempting to reconcile an unmounted child set; aligns with existing hidden/unmount behavior and prevents "children should not have changed" crash.
packages/react-devtools-shared/src/tests/store-test.js Adds regression test ensuring a newly-visible with stable children and a filtered wrapper reconciles without crashing and yields expected Store tree.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 9, 2026
@everettbu
everettbu deleted the sebbie/reveal-activity branch February 9, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants