Potential repro for possible bug w #26763#27465
Closed
josephsavona wants to merge 1 commit intofacebook:mainfrom
Closed
Potential repro for possible bug w #26763#27465josephsavona wants to merge 1 commit intofacebook:mainfrom
josephsavona wants to merge 1 commit intofacebook:mainfrom
Conversation
josephsavona
commented
Oct 4, 2023
Comment on lines
+202
to
+209
| <div | ||
| onClick={[Function]} | ||
| > | ||
| Expand | ||
| </div>, | ||
| <div> | ||
| Item 2 | ||
| </div>, |
Member
Author
There was a problem hiding this comment.
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.
|
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) |
sophiebits
reviewed
Oct 5, 2023
| const isExpanded = selectionContext.expanded.has(props.id); | ||
| const didInitiallyExpand = React.useRef(false); | ||
| const shouldInitiallyExpand = | ||
| props.initiallyExpanded && didInitiallyExpand.current === false; |
Collaborator
There was a problem hiding this comment.
technically reading the ref here is wrong but it's easy to move it into the effect (and likely unrelated to the issue here)
Member
|
When I run Looking through the CI failures, I see two reasons:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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