fix(iOS, FormSheet): Allow handling dynamic content size in FormSheet since 0.82 with synchronous updates enabled #3454
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.
Description
Follow-up to 4605692 where I introduced a regression causing content flickering. The regression occurs when the content is allowed to dynamically adjust to the screen size (e.g., using
flex: 1in styles). The issue is caused by the asynchronous nature of the ShadowNode state update for the screen, which leads to its size being updated with a delay relative to the detent change transition.It's important to note that this issue does not occur when the update is sent synchronously. Therefore, I'd like to propose allowing
flexin screen styles when a set of conditions are met:fitToContentsdefined insheetDetents.featureFlags.experiment.synchronousScreenUpdatesEnabledinreact-native-screensis enabled (for now, the default value remains disabled).Fixes #2522
Changes
flex: 1for FormSheetScreenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
Before
Screen.Recording.2025-12-05.at.11.11.53.mov
After
Screen.Recording.2025-12-05.at.11.13.45.mov
Test code and steps to reproduce
Test2522 - covering 4 cases: {flex, fixed height} x {detents from 0.0 to 1.0, fitToContents}
Checklist