Skip to content

Commit

Permalink
fix[devtools]: fixed Tree indentation logic after updating react-wind…
Browse files Browse the repository at this point in the history
…ows (facebook#28421)

Forward-fixing the indentation after landing
facebook#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 facebook#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
  • Loading branch information
hoxyq authored and AndyPengc12 committed Apr 15, 2024
1 parent 3174b21 commit 05cd596
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function updateIndentationSizeVar(
}

// $FlowFixMe[missing-local-annot]
function InnerElementType({children, style, ...rest}) {
function InnerElementType({children, style}) {
const {ownerID} = useContext(TreeStateContext);

const cachedChildWidths = useMemo<WeakMap<HTMLElement, number>>(
Expand Down Expand Up @@ -586,11 +586,7 @@ function InnerElementType({children, style, ...rest}) {
// A lot of options were considered; this seemed the one that requires the least code.
// See https://github.com/bvaughn/react-devtools-experimental/issues/9
return (
<div
className={styles.InnerElementType}
ref={divRef}
style={style}
{...rest}>
<div className={styles.InnerElementType} ref={divRef} style={style}>
<SelectedTreeHighlight />
{children}
</div>
Expand Down

0 comments on commit 05cd596

Please sign in to comment.