-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Don't disappear layout effects unnecessarily #25660
Merged
sammy-SC
merged 2 commits into
facebook:main
from
sammy-SC:offscreen-fix-incorrect-disappearLayoutEffects
Nov 10, 2022
Merged
Don't disappear layout effects unnecessarily #25660
sammy-SC
merged 2 commits into
facebook:main
from
sammy-SC:offscreen-fix-incorrect-disappearLayoutEffects
Nov 10, 2022
Conversation
This file contains 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
Nested Offscreens can run into a case where anscestor Offscreen is revealed while inner one is hidden. This is an edge case that was previously missed. We need to prevent call to disappear layout effects. Check unit tests for an example of this.
facebook-github-bot
added
the
React Core Team
Opened by a member of the React Core Team
label
Nov 10, 2022
acdlite
approved these changes
Nov 10, 2022
Comparing: 1e3e30d...d5adfe0 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) |
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Nov 10, 2022
Summary: This sync includes the following changes: - **[d1e35c703](facebook/react@d1e35c703 )**: Don't disappear layout effects unnecessarily ([#25660](facebook/react#25660)) //<Samuel Susla>// - **[1e3e30dae](facebook/react@1e3e30dae )**: Fix useSyncExternalStore dropped update when state is dispatched in render phase ([#25578](facebook/react#25578)) //<Aurélien Chivot-Buhler>// Changelog: [General][Changed] - React Native sync for revisions 4bd245e...d1e35c7 jest_e2e[run_all_tests] Reviewed By: GijsWeterings Differential Revision: D41187776 fbshipit-source-id: 9c82b79458487191f4a26cf643321603d30cea5a
mofeiZ
pushed a commit
to mofeiZ/react
that referenced
this pull request
Nov 17, 2022
Nested Offscreens can run into a case where outer Offscreen is revealed while inner one is hidden in a single commit. This is an edge case that was previously missed. We need to prevent call to disappear layout effects. When we go from state: ```jsx <Offscreen mode={'hidden'}> // outer offscreen <Offscreen mode={'visible'}> // inner offscreen {children} </Offscreen> </Offscreen> ``` To following. Notice that visibility of each offscreen flips. ```jsx <Offscreen mode={'visible'}> // outer offscreen <Offscreen mode={'hidden'}> // inner offscreen {children} </Offscreen> </Offscreen> ``` Inner offscreen must not call `recursivelyTraverseDisappearLayoutEffects`. Check unit tests for an example of this.
rickhanlonii
pushed a commit
that referenced
this pull request
Dec 3, 2022
Nested Offscreens can run into a case where outer Offscreen is revealed while inner one is hidden in a single commit. This is an edge case that was previously missed. We need to prevent call to disappear layout effects. When we go from state: ```jsx <Offscreen mode={'hidden'}> // outer offscreen <Offscreen mode={'visible'}> // inner offscreen {children} </Offscreen> </Offscreen> ``` To following. Notice that visibility of each offscreen flips. ```jsx <Offscreen mode={'visible'}> // outer offscreen <Offscreen mode={'hidden'}> // inner offscreen {children} </Offscreen> </Offscreen> ``` Inner offscreen must not call `recursivelyTraverseDisappearLayoutEffects`. Check unit tests for an example of this.
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this pull request
May 22, 2023
Summary: This sync includes the following changes: - **[d1e35c703](facebook/react@d1e35c703 )**: Don't disappear layout effects unnecessarily ([facebook#25660](facebook/react#25660)) //<Samuel Susla>// - **[1e3e30dae](facebook/react@1e3e30dae )**: Fix useSyncExternalStore dropped update when state is dispatched in render phase ([facebook#25578](facebook/react#25578)) //<Aurélien Chivot-Buhler>// Changelog: [General][Changed] - React Native sync for revisions 4bd245e...d1e35c7 jest_e2e[run_all_tests] Reviewed By: GijsWeterings Differential Revision: D41187776 fbshipit-source-id: 9c82b79458487191f4a26cf643321603d30cea5a
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.
Nested Offscreens can run into a case where outer Offscreen is revealed while inner one is hidden in a single commit. This is an edge case that was previously missed. We need to prevent call to disappear layout effects.
When we go from state:
To following. Notice that visibility of each offscreen flips.
Inner offscreen must not call
recursivelyTraverseDisappearLayoutEffects
.Check unit tests for an example of this.