File tree Expand file tree Collapse file tree
packages/react-devtools-shared/src/devtools/views/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import {
3636 UNKNOWN_SUSPENDERS_REASON_OLD_VERSION ,
3737 UNKNOWN_SUSPENDERS_REASON_THROWN_PROMISE ,
3838} from '../../../constants' ;
39+ import { ElementTypeRoot } from 'react-devtools-shared/src/frontend/types' ;
3940
4041type RowProps = {
4142 bridge : FrontendBridge ,
@@ -477,7 +478,21 @@ export default function InspectedElementSuspendedBy({
477478 </ div >
478479 ) ;
479480 }
480- return null ;
481+ // For roots, show an empty state since there's nothing else to show for
482+ // these elements.
483+ // This can happen for older versions of React without Suspense, older versions
484+ // of React with less sources for Suspense, or simple UIs that don't have any suspenders.
485+ if ( inspectedElement . type === ElementTypeRoot ) {
486+ return (
487+ < div >
488+ < div className = { styles . HeaderRow } >
489+ < div className = { `${ styles . Header } ${ styles . Empty } ` } >
490+ Nothing suspended the initial paint.
491+ </ div >
492+ </ div >
493+ </ div >
494+ ) ;
495+ }
481496 }
482497
483498 const handleCopy = withPermissionsCheck (
You can’t perform that action at this time.
0 commit comments