Skip to content

Support React Native 0.87 on 2.x - #4497

Merged
m-bert merged 7 commits into
v2-stablefrom
@mbert/v2-87
Sep 8, 2026
Merged

Support React Native 0.87 on 2.x#4497
m-bert merged 7 commits into
v2-stablefrom
@mbert/v2-87

Conversation

@m-bert

@m-bert m-bert commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Brings React Native 0.87 support to the 2.x line. Mirrors the changes already on main (#4247, #4310, #4311, #4319), trimmed to what the v2 code needs.

Native (iOS):

  • Remove the unused RCTRootContentView.h import. The header is gone from the prebuilt React-Core framework in 0.87.
  • RCTCxxBridge no longer exists, so the isViewFlatteningDisabled JSI binding is now installed via RCTTurboModuleWithJSIBindings. Gated behind REACT_NATIVE_MINOR_VERSION >= 87, older versions keep the previous code path.

TypeScript:

  • Bump TypeScript to 6.0.3 (cherry-pick of Bump TypeScript to 6.0.3 #4311) and switch moduleResolution to bundler. RN 0.87 exposes its types only through the package exports map.
  • Port the Strict TS API fixes (cherry-pick of Update types to respect Strict TS API #4319, v2 subset): CodegenTypes namespace and public codegenNativeComponent in specs, ComponentRef-based ref types in Pressable, Text, GestureComponents, style fixes in touchables.
  • Explicit type annotations in mocks.tsx and GestureHandlerButton.web.tsx. TS 6 refuses to emit declarations that reach RN's non-exported type aliases.
  • Cast in legacy Swipeable where interpolate overloads on a Value | AnimatedInterpolation union no longer unify.
  • unbound-method lint adjustments for methods RN 0.87 now types as class members.

Example apps:

  • Bump basic-example to RN 0.87.1, Reanimated 4.6.0, Worklets 0.12.1.
  • Pin expo to 56.0.21 and patch expo-modules-core 56.0.25 (executeSync -> runSync), which Worklets 0.12 removed. The resolution is keyed on the range expo declares, so the exact pin keeps the patch applying.
  • Type fixes in common-app examples for the 0.87 types.

Test plan

  • yarn ts-check, yarn lint-js, yarn jest
  • Build basic-example on iOS and Android
  • Build expo-example on iOS and Android

Currently we use TypeScript 5. Starting from 0.87, React Native uses
TyoeScript 6. I think it is good time to adapt to these changes and bump
it in our repository.

I've left docs since they are not part of workspaces.

- `yarn ts-check`
- Installed Gesture Handler from generated package

(cherry picked from commit 17d3df8)
Since React Native 0.87, Strict TS API is [enabled by default
](react/react-native#57490). This PR brings
necessary changes to resolve ts-errors on 0.87.

This PR also removes `cursor: undefined;` from `iOS`, but now it is a
valid prop - this workaround was necessary on old arch

`yarn ts-check`

(cherry picked from commit 7d2f321)
Copilot AI lite review requested due to automatic review settings September 8, 2026 11:50
@m-bert m-bert changed the title Bump dependencies Support React Native 0.87 on 2.x Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2e8867e7-068b-4d1d-b9cc-5a494ef56634

📥 Commits

Reviewing files that changed from the base of the PR and between f68a21a and f93f08e.

⛔ Files ignored due to path filters (4)
  • .yarn/patches/expo-modules-core-npm-56.0.25-a715438de2.patch is excluded by !**/.yarn/**
  • apps/basic-example/android/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • apps/basic-example/ios/Podfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (44)
  • apps/basic-example/android/app/build.gradle
  • apps/basic-example/android/build.gradle
  • apps/basic-example/android/gradle.properties
  • apps/basic-example/android/gradle/wrapper/gradle-wrapper.properties
  • apps/basic-example/android/gradlew
  • apps/basic-example/ios/BasicExample/PrivacyInfo.xcprivacy
  • apps/basic-example/package.json
  • apps/basic-example/src/Navigator.tsx
  • apps/basic-example/tsconfig.json
  • apps/common-app/package.json
  • apps/common-app/src/ListWithHeader/ListWithHeader.tsx
  • apps/common-app/src/new_api/calculator/index.tsx
  • apps/common-app/src/recipes/panAndScroll/index.tsx
  • apps/common-app/src/recipes/scaleAndRotate/index.tsx
  • apps/common-app/src/release_tests/combo/index.tsx
  • apps/common-app/src/release_tests/nestedFling/index.tsx
  • apps/common-app/src/release_tests/touchables/index.tsx
  • apps/common-app/src/showcase/bottomSheet/index.tsx
  • apps/common-app/tsconfig.json
  • apps/expo-example/package.json
  • apps/expo-example/tsconfig.json
  • apps/macos-example/package.json
  • apps/macos-example/tsconfig.json
  • package.json
  • packages/react-native-gesture-handler/apple/RNGestureHandlerManager.mm
  • packages/react-native-gesture-handler/apple/RNGestureHandlerModule.mm
  • packages/react-native-gesture-handler/package.json
  • packages/react-native-gesture-handler/src/components/GestureComponents.tsx
  • packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx
  • packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx
  • packages/react-native-gesture-handler/src/components/Pressable/PressableProps.tsx
  • packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx
  • packages/react-native-gesture-handler/src/components/Swipeable.tsx
  • packages/react-native-gesture-handler/src/components/Text.tsx
  • packages/react-native-gesture-handler/src/components/touchables/TouchableHighlight.tsx
  • packages/react-native-gesture-handler/src/components/touchables/TouchableNativeFeedback.android.tsx
  • packages/react-native-gesture-handler/src/components/touchables/TouchableOpacity.tsx
  • packages/react-native-gesture-handler/src/mocks/mocks.tsx
  • packages/react-native-gesture-handler/src/specs/NativeRNGestureHandlerModule.ts
  • packages/react-native-gesture-handler/src/specs/RNGestureHandlerButtonNativeComponent.ts
  • packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts
  • packages/react-native-gesture-handler/tsconfig.build.json
  • tsconfig.json
  • yarn.config.cjs
💤 Files with no reviewable changes (5)
  • apps/common-app/tsconfig.json
  • apps/basic-example/src/Navigator.tsx
  • apps/macos-example/tsconfig.json
  • apps/expo-example/tsconfig.json
  • packages/react-native-gesture-handler/apple/RNGestureHandlerManager.mm

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added compatibility with React Native 0.87, including updated gesture-handler integration.
    • Pressable, ScrollView, Text, and related components now provide improved ref support and TypeScript compatibility.
    • Android example builds now support edge-to-edge display.
  • Bug Fixes

    • Improved style handling to prevent unintended modifications to caller-provided styles.
    • Updated touchable and gesture components for more reliable type-safe behavior.
  • Chores

    • Updated example applications and tooling for newer React Native, Expo, Reanimated, Worklets, Kotlin, Android SDK, and TypeScript versions.

Walkthrough

The pull request updates the repository for React Native 0.87, Reanimated 4.6, Worklets 0.12, and TypeScript 6. It adds the React Native 0.87 iOS JSI integration and updates gesture-handler types, codegen imports, build settings, and example applications.

Changes

Toolchain and example alignment

Layer / File(s) Summary
Toolchain and example alignment
apps/*, package.json, tsconfig.json, yarn.config.cjs
Example applications and repository configuration update React Native, Android, Expo, Gradle, TypeScript, and shared dependency versions. TypeScript removes baseUrl in several configurations and uses bundler module resolution.
React Native 0.87 iOS module support
packages/react-native-gesture-handler/apple/*, packages/react-native-gesture-handler/package.json
RNGestureHandlerModule uses RCTTurboModuleWithJSIBindings for React Native 0.87 and retains the legacy bridge path for earlier versions.
Public React Native type migration
packages/react-native-gesture-handler/src/*, packages/react-native-gesture-handler/tsconfig.build.json
Component refs, codegen types, host components, mocks, animated types, and native component declarations are aligned with current React Native and TypeScript APIs.
Component behavior and lint updates
apps/common-app/src/*, packages/react-native-gesture-handler/src/components/*
Style composition avoids mutating input styles. Touchable styling uses explicit style arrays. Updated lint rules receive targeted suppressions.

Sequence Diagram(s)

sequenceDiagram
  participant RNGestureHandlerModule
  participant ReactNative087
  participant JSIRuntime
  RNGestureHandlerModule->>ReactNative087: register RCTTurboModuleWithJSIBindings
  ReactNative087->>RNGestureHandlerModule: installJSIBindingsWithRuntime
  RNGestureHandlerModule->>JSIRuntime: decorateRuntime(runtime)
Loading

Merge Risk: ⚪ Minimal · up to f93f0

No actionable merge-blocking risk is established for the current changes.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding React Native 0.87 support to the 2.x line.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Pressable ref changes treat ref as a normal prop without React.forwardRef, so consumer refs won’t actually be forwarded and the new API surface is misleading.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the 2.x line to build and typecheck against React Native 0.87, aligning native iOS integration changes with RN’s removal of old-arch headers and adopting TypeScript 6 + Strict TS API type adjustments across the library and examples.

Changes:

  • Update iOS new-arch JSI binding installation for RN 0.87 and remove an obsolete React header import.
  • Switch the repo to TypeScript 6.0.3 and adjust type definitions/specs to comply with RN 0.87’s exports + Strict TS API.
  • Bump example apps and tooling dependencies (RN 0.87.1, Reanimated/Worklets) and add an Expo modules patch via Yarn resolutions.
File summaries
File Description
yarn.config.cjs Bump shared Reanimated/Worklets versions
tsconfig.json Switch moduleResolution to bundler
packages/react-native-gesture-handler/tsconfig.build.json Set rootDir to src
packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts Use public codegenNativeComponent typing
packages/react-native-gesture-handler/src/specs/RNGestureHandlerButtonNativeComponent.ts Update CodegenTypes + HostComponent cast
packages/react-native-gesture-handler/src/specs/NativeRNGestureHandlerModule.ts Use CodegenTypes.Double in spec
packages/react-native-gesture-handler/src/mocks/mocks.tsx Add explicit component type casts
packages/react-native-gesture-handler/src/components/touchables/TouchableOpacity.tsx Lint adjustment for unbound-method
packages/react-native-gesture-handler/src/components/touchables/TouchableNativeFeedback.android.tsx Tighten return typing / prop cast
packages/react-native-gesture-handler/src/components/touchables/TouchableHighlight.tsx Style composition type workaround
packages/react-native-gesture-handler/src/components/Text.tsx Ref type to ComponentRef
packages/react-native-gesture-handler/src/components/Swipeable.tsx Cast to satisfy interpolate overloads
packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx Lint adjustment for unbound-method
packages/react-native-gesture-handler/src/components/Pressable/PressableProps.tsx Ref type change in props
packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx Attempt to pass ref through
packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx Add explicit forwardRef component type
packages/react-native-gesture-handler/src/components/GestureComponents.tsx Ref types + DrawerLayoutAndroid typing
packages/react-native-gesture-handler/package.json Bump RN, TS, Reanimated/Worklets devDeps
packages/react-native-gesture-handler/apple/RNGestureHandlerModule.mm RN 0.87 JSI binding install path
packages/react-native-gesture-handler/apple/RNGestureHandlerManager.mm Remove obsolete RCTRootContentView import
package.json Bump TS + add Expo modules patch resolution
apps/macos-example/tsconfig.json Remove baseUrl (inherit root config)
apps/macos-example/package.json Bump TypeScript version
apps/expo-example/tsconfig.json Remove baseUrl (inherit root config)
apps/expo-example/package.json Pin Expo + bump deps/TS
apps/common-app/tsconfig.json Remove baseUrl (inherit root config)
apps/common-app/src/showcase/bottomSheet/index.tsx Animated generic type adjustments
apps/common-app/src/release_tests/touchables/index.tsx Update background prop typing
apps/common-app/src/release_tests/nestedFling/index.tsx Animated generic type adjustments
apps/common-app/src/release_tests/combo/index.tsx ComponentRef-based ScrollView ref type
apps/common-app/src/recipes/scaleAndRotate/index.tsx Animated generic type adjustments
apps/common-app/src/recipes/panAndScroll/index.tsx Animated generic type adjustments
apps/common-app/src/new_api/calculator/index.tsx ComponentRef-based ScrollView refs
apps/common-app/src/ListWithHeader/ListWithHeader.tsx Avoid mutating flattened style object
apps/common-app/package.json Bump Reanimated/Worklets + TS
apps/basic-example/tsconfig.json Remove baseUrl/types override
apps/basic-example/src/Navigator.tsx Remove unnecessary unbound-method disable
apps/basic-example/package.json Bump RN 0.87.1 + toolchain deps
apps/basic-example/ios/Podfile.lock Update iOS pods for RN 0.87
apps/basic-example/ios/BasicExample/PrivacyInfo.xcprivacy Swap privacy accessed API entries
apps/basic-example/android/gradlew Pin Gradle template source URL
apps/basic-example/android/gradle/wrapper/gradle-wrapper.properties Bump Gradle distribution version
apps/basic-example/android/gradle.properties Enable edge-to-edge + AGP opt-outs
apps/basic-example/android/build.gradle Bump SDK/buildtools/Kotlin versions
apps/basic-example/android/app/build.gradle Use optimized Proguard default file
.yarn/patches/expo-modules-core-npm-56.0.25-a715438de2.patch Patch executeSync -> runSync
Review details
  • Files reviewed: 44/48 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 68 to +72
accessible,
simultaneousWithExternalGesture,
requireExternalGestureToFail,
blocksExternalGesture,
ref,
Comment on lines 66 to 70
/**
* A reference to the pressable element.
*/
ref?: React.Ref<View>;
ref?: React.Ref<React.ComponentRef<typeof View>>;

@m-bert
m-bert merged commit 9e4df29 into v2-stable Sep 8, 2026
12 checks passed
@m-bert
m-bert deleted the @mbert/v2-87 branch September 8, 2026 12:27
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.

3 participants