File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
packages/react-devtools-shared/src/devtools/views/Components Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ import type {
4545 InspectedElementContextType ,
4646 StoreAsGlobal ,
4747} from './InspectedElementContext' ;
48- import type { Element , InspectedElement } from './types' ;
48+ import type { Element , InspectedElement , Owner } from './types' ;
4949import type { ElementType } from 'react-devtools-shared/src/types' ;
5050
5151export type Props = { || } ;
@@ -380,10 +380,9 @@ function InspectedElementView({
380380 rendererPackageName !== null && rendererVersion !== null
381381 ? `${ rendererPackageName } @${ rendererVersion } `
382382 : null ;
383+ const showOwnersList = owners !== null && owners . length > 0 ;
383384 const showRenderedBy =
384- ( owners !== null && owners . length > 0 ) ||
385- rendererLabel !== null ||
386- rootType !== null ;
385+ showOwnersList || rendererLabel !== null || rootType !== null ;
387386
388387 return (
389388 < Fragment >
@@ -429,9 +428,8 @@ function InspectedElementView({
429428 { showRenderedBy && (
430429 < div className = { styles . Owners } >
431430 < div className = { styles . OwnersHeader } > rendered by</ div >
432- { owners !== null &&
433- owners . length > 0 &&
434- owners . map ( owner => (
431+ { showOwnersList &&
432+ ( ( owners : any ) : Array < Owner > ) . map ( owner => (
435433 < OwnerView
436434 key = { owner . id }
437435 displayName = { owner . displayName || 'Anonymous' }
You can’t perform that action at this time.
0 commit comments