Skip to content

[DevTools] Wrap each tab in <Activity> if available#135

Open
everettbu wants to merge 1 commit into
mainfrom
sebbie/09-08-_devtools_wrap_each_tab_in_activity_
Open

[DevTools] Wrap each tab in <Activity> if available#135
everettbu wants to merge 1 commit into
mainfrom
sebbie/09-08-_devtools_wrap_each_tab_in_activity_

Conversation

@everettbu

@everettbu everettbu commented Dec 12, 2025

Copy link
Copy Markdown

Mirror of facebook/react#34426
Original author: eps1lon


The divs are already hidden={true} so we can tell React to deprioritize the hidden tabs. That way Suspense related effects like auto-scroll and suspense auto-selection don't apply while using the Components tab.

I also introduced StrictMode into the DevTools tree to find potential issues.

@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 12, 2025
@greptile-apps

greptile-apps Bot commented Dec 12, 2025

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR enhances React DevTools by wrapping each tab in <Activity> to deprioritize hidden tabs and introducing <StrictMode> for better error detection.

  • Wrapped Components, Profiler, and Suspense tabs in <MaybeActivity> with mode="hidden" or mode="visible" based on active tab
  • Added graceful fallback for environments where React.Activity or React.unstable_Activity is not available
  • Wrapped entire DevTools tree in <StrictMode> to surface potential issues during development
  • Fixed bug in UseEffectEvent.js where destructuring incorrectly extracted onClick from custom hook

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are well-structured performance optimizations and bug fixes. The Activity wrapper correctly implements the mode prop (hidden/visible), includes proper fallback for older React versions, and the StrictMode addition helps catch potential issues. The UseEffectEvent bug fix is straightforward and correct.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react-devtools-shared/src/devtools/views/DevTools.js 5/5 Wrapped tabs in <Activity> to deprioritize hidden tabs and added <StrictMode> wrapper to DevTools tree
packages/react-devtools-shell/src/app/InspectableElements/UseEffectEvent.js 5/5 Fixed destructuring to properly extract onClick from custom hook's return array

@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

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