Skip to content

Conversation

@eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Jan 13, 2026

Stacked on #35240

We used to only show a blank pane when no element is selected. This was ok when we only showed the inspected element pane in the Components and Suspense tab since you couldn't escape inspection.

However, when showing the inspected element pane in the browsers Elements panel, you can select elements that aren't owned by React and therefore won't inspect an element. Now we show a configurable fallback.

For the inspected element pane in the browser's Elements panel, we display "No element rendered by React selected.".

CleanShot 2026-01-13 at 16 20 50@2x

Otherwise "No React element selected."

CleanShot 2026-01-13 at 16 20 22@2x

Styling and layout is similar to the loading fallback but not dimmed since the fallback for no selection may be visible indefinitely.

@meta-cla meta-cla bot added the CLA Signed label Jan 13, 2026
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jan 13, 2026
padding: 0.25rem;
color: var(--color-dimmer);
font-style: italic;
border-left: 1px solid var(--color-border);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Placing the border here made the border only span a single line. Now the border is one the whole container while also not being duplicated if the parent already defines a border. This makes composition easier with regards to border drawing.

return (
<div className={styles.InspectedElement}>
<div className={styles.TitleRow} />
<div className={styles.NoInspectionFallback}>{fallbackEmpty}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We also show the loading fallback below the title row.

@eps1lon eps1lon force-pushed the sebbie/01-13-_devtools_show_fallback_in_inspected_element_pane_when_no_element_is_selected branch from 952f8ee to 51d62c9 Compare January 13, 2026 15:47
@eps1lon eps1lon marked this pull request as ready for review January 13, 2026 15:47
@eps1lon eps1lon requested a review from hoxyq January 13, 2026 15:47
@eps1lon eps1lon force-pushed the sebbie/01-13-_devtools_show_fallback_in_inspected_element_pane_when_no_element_is_selected branch from 51d62c9 to 2bc6bf4 Compare January 13, 2026 17:28
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.

1 participant