Skip to content

Conversation

t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Oct 6, 2025

Description

This PR adds support for synchronous updates in the native stack for React Native 0.82+. Currently, enabling synchronous state updates is possible via an experimental feature flag: unstable_synchronousStateUpdatesEnabled.

At this time, I haven't found a way to perform synchronous updates on Android, so this PR only includes mocks for that platform. I'm creating a ticket for covering that: https://github.com/software-mansion/react-native-screens-labs/issues/497

Fixes https://github.com/software-mansion/react-native-screens-labs/issues/495

Changes

  • Added feature flag in JS unstable_synchronousStateUpdatesEnabled for testing synchronous updates.
  • Added mocks for android implementation
  • Added implementation for all native components on iOS that are performing shadow tree state updates

Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

Before

before.mov

After

after.mov

Test code and steps to reproduce

Adding a new example, which is verifying that with synchronous updates enabled, the form sheet content flicker issues are resolved.

Checklist

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

Base automatically changed from t0maboro/split-view-synchronous-updates to main October 6, 2025 13:23
@t0maboro t0maboro force-pushed the @t0maboro/native-stack-synchronous-updates branch from b794a54 to 3a71e96 Compare October 6, 2025 13:24
@t0maboro t0maboro marked this pull request as ready for review October 6, 2025 13:37
@t0maboro t0maboro changed the title Draft: add support for synchronous state updates on fabric for native stack feat(StackV4): Add support for synchronous state updates on fabric for native stack Oct 6, 2025
@t0maboro t0maboro changed the title feat(StackV4): Add support for synchronous state updates on fabric for native stack feat(Stack): Add support for synchronous state updates on fabric for native stack Oct 6, 2025
Copy link
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

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

Looks good!

RCT_EXPORT_VIEW_PROPERTY(leftScrollEdgeEffect, RNSScrollEdgeEffect);
RCT_EXPORT_VIEW_PROPERTY(rightScrollEdgeEffect, RNSScrollEdgeEffect);
RCT_EXPORT_VIEW_PROPERTY(topScrollEdgeEffect, RNSScrollEdgeEffect);
RCT_EXPORT_VIEW_PROPERTY(unstable_synchronousUpdatesEnabled, BOOL);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we need this prop on Paper, as it won't work there but we might want to check if there is any warning if you pass a prop that hasn't been exported.

We can also leave the prop exported but for consistency I'd do it in other components as well (e.g. RNSScreenStackHeaderConfig).

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.

2 participants