Skip to content

Conversation

@t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Dec 5, 2025

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: 1 in 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 flex in screen styles when a set of conditions are met:

  • The formSheet does not have fitToContents defined in sheetDetents.
  • React Native version is at least 0.82 (the one which introduced synchronous state updates).
  • The feature flag featureFlags.experiment.synchronousScreenUpdatesEnabled in react-native-screens is enabled (for now, the default value remains disabled).

Fixes #2522

Changes

  • Added conditional style with flex: 1 for FormSheet

Screenshots / 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

  • Included code example that can be used to test this change
  • Ensured that CI passes

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I'll check the runtime soon & will be back here.

Thanks!

@t0maboro t0maboro requested a review from kkafar December 5, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StackNavigator as formSheet content has size of zero (iOS)

4 participants