Skip to content
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

DevTools: Only show StrictMode badge on root elements #23012

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export default function Element({data, index, style}: Props) {
type,
} = ((element: any): ElementType);

// Only show strict mode non-compliance badges for top level elements.
// Showing an inline badge for every element in the tree would be noisy.
const showStrictModeBadge = isStrictModeNonCompliant && depth === 0;

let className = styles.Element;
if (isSelected) {
className = treeFocused
Expand Down Expand Up @@ -194,7 +198,7 @@ export default function Element({data, index, style}: Props) {
}
/>
)}
{isStrictModeNonCompliant && (
{showStrictModeBadge && (
<Icon
className={
isSelected && treeFocused
Expand Down