-
Notifications
You must be signed in to change notification settings - Fork 50.5k
[DevTools] Add React Element pane to browser Elements panel #35240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eps1lon
merged 3 commits into
facebook:main
from
eps1lon:sebbie/11-28-_devtools_add_react_element_pane_to_browser_elements_panel
Jan 15, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/react-devtools-shared/src/devtools/views/InspectedElement/InspectedElementPane.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| .InspectedElementPane, .InspectedElementPane * { | ||
| box-sizing: border-box; | ||
| -webkit-font-smoothing: var(--font-smoothing); | ||
| } | ||
|
|
||
| .InspectedElementPane { | ||
| position: relative; | ||
| width: 100%; | ||
| height: 100%; | ||
| display: flex; | ||
| flex-direction: row; | ||
| background-color: var(--color-background); | ||
| color: var(--color-text); | ||
| font-family: var(--font-family-sans); | ||
| } |
34 changes: 34 additions & 0 deletions
34
packages/react-devtools-shared/src/devtools/views/InspectedElement/InspectedElementPane.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow | ||
| */ | ||
|
|
||
| import * as React from 'react'; | ||
| import {useContext} from 'react'; | ||
|
|
||
| import portaledContent from 'react-devtools-shared/src/devtools/views/portaledContent'; | ||
| import {OptionsContext} from 'react-devtools-shared/src/devtools/views/context'; | ||
| import InspectedElement from 'react-devtools-shared/src/devtools/views/Components/InspectedElement'; | ||
| import SettingsModal from 'react-devtools-shared/src/devtools/views/Settings/SettingsModal'; | ||
| import SettingsModalContextToggle from 'react-devtools-shared/src/devtools/views/Settings/SettingsModalContextToggle'; | ||
| import {SettingsModalContextController} from 'react-devtools-shared/src/devtools/views/Settings/SettingsModalContext'; | ||
| import styles from './InspectedElementPane.css'; | ||
|
|
||
| function InspectedElementPane() { | ||
| const {hideSettings} = useContext(OptionsContext); | ||
| return ( | ||
| <SettingsModalContextController> | ||
| <div className={styles.InspectedElementPane}> | ||
| <InspectedElement | ||
| actionButtons={!hideSettings && <SettingsModalContextToggle />} | ||
| /> | ||
| <SettingsModal /> | ||
| </div> | ||
| </SettingsModalContextController> | ||
| ); | ||
| } | ||
| export default (portaledContent(InspectedElementPane): component()); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used as a min-height or how does this work? Might be worth double-checking the case when an element has a long list of props or hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was copied from the added sources pane. Though it's not supported in Firefox: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools/panels/ExtensionSidebarPane#browser_compatibility
I follow-up on this since whatever change we make, should affect all ExtensionSidebarPane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually will do this now since I can't test Firefox otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in a follow-up since Firefox support is blocked by https://bugzilla.mozilla.org/show_bug.cgi?id=2010549