diff --git a/src/devtools/views/Components/Tree.js b/src/devtools/views/Components/Tree.js index 5bb94c77f7..b97ff5a9cf 100644 --- a/src/devtools/views/Components/Tree.js +++ b/src/devtools/views/Components/Tree.js @@ -198,12 +198,15 @@ function InnerElementType({ style, ...rest }) { // We shouldn't retain this width across different conceptual trees though, // so when the user opens the "owners tree" view, we should discard the previous width. const divRef = useRef(null); - const minWidthRef = useRef(parseInt(style.width, 10)); - const minWidth = ownerStack.length > 0 ? '100%' : minWidthRef.current; + const minWidthRef = useRef(null); + const minWidth = + ownerStack.length > 0 || minWidthRef.current === null + ? '100%' + : minWidthRef.current; useEffect(() => { if (divRef.current !== null) { minWidthRef.current = Math.max( - minWidthRef.current, + minWidthRef.current || 0, divRef.current.offsetWidth ); }