mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[DevTools] Don't show the root as being non-compliant (#34827)
`isStrictModeNonCompliant` on the root just means that it supports strict mode. It's inherited by other nodes. It's not possible to opt-in to strict mode on the root itself but rather right below it. So we should not mark the root as being non-compliant. This lets you select the root in the suspense tab and it shouldn't show as red with a warning.
This commit is contained in:
committed by
GitHub
parent
34b1567427
commit
e2ce64acb9
@@ -194,7 +194,7 @@ export default function InspectedElementWrapper(_: Props): React.Node {
|
||||
}
|
||||
|
||||
let strictModeBadge = null;
|
||||
if (element.isStrictModeNonCompliant) {
|
||||
if (element.isStrictModeNonCompliant && element.parentID !== 0) {
|
||||
strictModeBadge = (
|
||||
<Tooltip label="This component is not running in StrictMode. Click to learn more.">
|
||||
<a
|
||||
@@ -237,7 +237,7 @@ export default function InspectedElementWrapper(_: Props): React.Node {
|
||||
<div className={styles.SelectedComponentName}>
|
||||
<div
|
||||
className={
|
||||
element.isStrictModeNonCompliant
|
||||
element.isStrictModeNonCompliant && element.parentID !== 0
|
||||
? `${styles.ComponentName} ${styles.StrictModeNonCompliantComponentName}`
|
||||
: styles.ComponentName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user