Skip to content

fix(DevTools): show empty props object when none are present#104

Closed
everettbu wants to merge 2 commits into
mainfrom
fix/devtools-props-empty-fallback
Closed

fix(DevTools): show empty props object when none are present#104
everettbu wants to merge 2 commits into
mainfrom
fix/devtools-props-empty-fallback

Conversation

@everettbu

@everettbu everettbu commented Dec 12, 2025

Copy link
Copy Markdown

Mirror of facebook/react#33651
Original author: ShashankVashishtha18


When a component has no props, DevTools previously showed undefined. This patch ensures it renders an empty props: {} object instead, for consistency and clarity in the UI.

@greptile-apps

greptile-apps Bot commented Dec 12, 2025

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

Fixed DevTools to display an empty props: {} object instead of hiding the props section when a component has no props.

  • Replaced early-return null check with nullish coalescing fallback in InspectedElementPropsTree.js
  • Changed behavior from hiding entire props section to showing header with empty state
  • Version bumped to 19.2.0-canary for React mirror repository sync

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is minimal, well-scoped, and improves UI consistency. The nullish coalescing operator correctly handles both null and undefined cases, and the existing isEmpty logic properly handles the empty object case. The version bump is standard for this mirror repository.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementPropsTree.js 5/5 Replaced null-check early return with fallback to empty object, ensuring props header always displays
packages/shared/ReactVersion.js 5/5 Version bumped to 19.2.0-canary with commit reference for React mirror sync

@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 everettbu added the Resolution: Stale Automatically closed due to inactivity label Jan 11, 2026
@github-actions

Copy link
Copy Markdown

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@github-actions github-actions Bot closed this Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Resolution: Stale Automatically closed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants