Skip to content

Consistent handling of work tags for rename, delete, and overriding state#497

Closed
everettbu wants to merge 1 commit into
mainfrom
sebbie/02-10-consistent_handling_of_work_tags_for_rename_delete_and_overriding_state
Closed

Consistent handling of work tags for rename, delete, and overriding state#497
everettbu wants to merge 1 commit into
mainfrom
sebbie/02-10-consistent_handling_of_work_tags_for_rename_delete_and_overriding_state

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35740
Original author: eps1lon


Mostly to make it easier to reason locally about this code. Rename and delete relied implicitly on inspectElementRaw to only show state for Class Components but there was already a TODO to expand that which would've crashed rename and delete.

Flagged by Claude + Opus 4.6 (which didn't make the connection with inspectElementRaw and assumed this fixes a crash).

@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 10, 2026
@everettbu
everettbu marked this pull request as ready for review February 10, 2026 10:31
@greptile-apps

greptile-apps Bot commented Feb 10, 2026

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This change makes delete, rename, and override of "state" consistent with the set of Fiber tags for which DevTools actually exposes state in inspectFiberInstanceRaw. Concretely, the state-editing message handlers now gate the mutation/forceUpdate() calls behind explicit fiber.tag checks, preventing crashes if inspectElementRaw is expanded to show state for more non-class tags in the future.

The change is localized to the backend Fiber renderer message handling in packages/react-devtools-shared/src/backend/fiber/renderer.js and does not affect the frontend UI beyond avoiding invalid state operations.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • The change is small, self-contained, and adds conservative guards around state mutation paths to align with existing inspection behavior; no new APIs or external integrations are introduced.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react-devtools-shared/src/backend/fiber/renderer.js Adds explicit fiber tag checks for state delete/rename/override so these operations only run for class(-like) components where state is exposed.

@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.

1 file 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 10, 2026
@everettbu
everettbu deleted the sebbie/02-10-consistent_handling_of_work_tags_for_rename_delete_and_overriding_state branch February 10, 2026 15:40
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