-
Notifications
You must be signed in to change notification settings - Fork 47.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential repro for possible bug w #26763 #27465
Conversation
<div | ||
onClick={[Function]} | ||
> | ||
Expand | ||
</div>, | ||
<div> | ||
Item 2 | ||
</div>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both items should be "expanded", so this should be showing <div>Item 1</div><div>Item 2</div>
. But somehow only the useEffect from the second item takes effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rickhanlonii see comment here
Comparing: 0fba3ec...9fe5904 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
const isExpanded = selectionContext.expanded.has(props.id); | ||
const didInitiallyExpand = React.useRef(false); | ||
const shouldInitiallyExpand = | ||
props.initiallyExpanded && didInitiallyExpand.current === false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically reading the ref here is wrong but it's easy to move it into the effect (and likely unrelated to the issue here)
When I run Looking through the CI failures, I see two reasons:
|
Possible bug w #26763. See comments for more. This is a simplified version of an internal test that failed after #26763, where we observed a different set of useEffects fired prior to taking a snapshot with ReactTestRenderer. This PR isn't a perfect repro, since manually reverting the changes from the above PR doesn't produce the expected result on this snapshot. But this is potentially in the ballpark of a repro, since the original code internally did fail and the expected result is different than expected in a similar way to the internal failure: a different set of useEffects runs as part of the act() call.
Related to #27463