Skip to content

feat: consume upstream react-native-screens nested-scroll seam - #27

Draft
AmatoGiulio wants to merge 9 commits into
mainfrom
feat/react-native-screens-upstream-delegate
Draft

feat: consume upstream react-native-screens nested-scroll seam#27
AmatoGiulio wants to merge 9 commits into
mainfrom
feat/react-native-screens-upstream-delegate

Conversation

@AmatoGiulio

@AmatoGiulio AmatoGiulio commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Goal

Consume the neutral Android nested-scroll delegate seam prototyped in AmatoGiulio/react-native-screens#1 without making react-native-screens depend on this package.

The goal is the generic transport path, not the Material3 reference UI.

Design

  • keep the existing generic ReactNativeScreenNestedScrollBridge as the implementation;
  • compile the react-native-screens adapter only when the installed screens project actually contains ScreenNestedScrollInterop.kt;
  • keep the main Android source set completely independent of com.swmansion.rnscreens;
  • leave react-native-screens 4.26.x behavior unchanged;
  • install the optional adapter once from the standard RN package composition root;
  • no per-frame reflection: reflection is used only once to discover the optional installer class;
  • ship the optional source set in the npm tarball and assert that through check:package-surface;
  • document the updated upstream design: current native-stack ScreensCoordinatorLayout + new Stack StackHeaderCoordinatorLayout, rather than patching Screen directly.

Upstream ownership

The screens prototype always runs react-native-screens' existing CoordinatorLayout/AppBar/BottomSheet behavior first. This package receives only the nested-scroll distance still available afterward. React Native remains the source touch/position/fling owner.

Validation

  • react-native-screens fork lint JS: PASS
  • react-native-screens fork typecheck: PASS
  • react-native-screens fork Android lint / Spotless: PASS
  • react-native-screens fork Android Fabric arm64-v8a build: PASS
  • react-native-scroll-interop + forked react-native-screens Kotlin compile in a bare RN consumer: PASS
  • external React Navigation native-stack runtime proof: PASS
    • no NativeScrollHost around the screen;
    • real ReactNestedScrollView bound through the screens seam;
    • Material3 reference consumer resolves as topBar=true and transaction becomes active=true;
    • touch scroll / reverse: PASS;
    • fling / reverse fling / non-touch momentum: PASS;
    • touch-to-momentum handoff reaches momentum-stop;
    • completed transaction conservation remains broken=0;
    • forward navigation binds the next screen source; Back restores the previous source and frontmost ownership;
    • no crash, jump or double consumption observed.

The debug ledger also reports some orphanPre entries where React Native emits a PRE callback without a corresponding POST callback. These are counted separately and are not broken completed frames; all completed frames in the runtime proof remained balanced (broken=0).

This PR remains draft and is not intended for merge or publish until an official react-native-screens release contains the seam. No version change and no npm publish.

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.

1 participant