fix[devtools]: fixed Tree indentation logic after updating react-windows (#28421)
Forward-fixing the indentation after landing https://github.com/facebook/react/pull/28408. Could potentially be related to `ref` changes in `react`, but haven't validated yet. Haven't occured while testing the previous PR, but reproduced while testing the https://github.com/facebook/react/pull/28418, for which I've rebuilt all dependencies, including `react`. This change basically removes the props passing from original parent, `rest` should include only `ref`: https://github.com/bvaughn/react-window/blob/efad3d8909753fd74aad7c47dc902b26f0919651/src/createListComponent.js#L382
Ruslan Lesiutin committed
Feb 22, 2024 at 19:18 UTC
d54b4cf303143b459c3caae54d14ae926a8ee09a
1 file changed
+2
-6
packages/react-devtools-shared/src/devtools/views/Components/Tree.js
+2
-6
@@ -538,7 +538,7 @@ function updateIndentationSizeVar(
538
}
539
540
// $FlowFixMe[missing-local-annot]
541
-function InnerElementType({children, style, ...rest}) {
541
+function InnerElementType({children, style}) {
542
const {ownerID} = useContext(TreeStateContext);
543
544
const cachedChildWidths = useMemo<WeakMap<HTMLElement, number>>(
@@ -586,11 +586,7 @@ function InnerElementType({children, style, ...rest}) {
586
// A lot of options were considered; this seemed the one that requires the least code.
587
// See https://github.com/bvaughn/react-devtools-experimental/issues/9
588
return (
589
- <div
590
- className={styles.InnerElementType}
591
- ref={divRef}
592
- style={style}
593
- {...rest}>
589
+ <div className={styles.InnerElementType} ref={divRef} style={style}>
590
<SelectedTreeHighlight />
591
{children}
592
</div>