Skip to content

refactor: upgrade React Native to 0.85.3 (React 19) #3781

Merged
grimen merged 24 commits into
mainfrom
refactor--upgrade-react-native
May 27, 2026
Merged

refactor: upgrade React Native to 0.85.3 (React 19) #3781
grimen merged 24 commits into
mainfrom
refactor--upgrade-react-native

Conversation

@esaugomez31
Copy link
Copy Markdown
Collaborator

@esaugomez31 esaugomez31 commented May 26, 2026

Summary

Upgrades React Native from 0.76.9 to 0.85.3, React from 18.3.1 to 19.2.3, and the reanimated stack from 3.16.7 to 4.3.1 (with the new react-native-worklets 0.8.0 dependency split). Required to keep the iOS app on a supported toolchain (Apple App Store iOS 26 SDK requirement).

Stack delta

  • React Native: 0.76.9 → 0.85.3
  • React / react-dom: 18 → 19.2.3 (+ react-test-renderer 19.2.3)
  • @testing-library/react-native: 12.x → 13.3.3
  • react-native-reanimated: 3.16.7 → 4.3.1
  • react-native-worklets: NEW 0.8.0 (split out of reanimated v4)
  • react-native-gesture-handler: 2.25 → 2.31.2
  • react-native-screens: ≥4.0 <4.5 → ≥4.25 <4.26
  • react-native-camera-kit: 16.x → 18.x (16.x C++ codegen breaks on RN 0.85)
  • react-native-svg: 15.8.0 → 15.15.5 (ImageResponseObserver API change in RN 0.84+)
  • react-native-view-shot: 4.x → 5.x (RCTScrollView removed in RN 0.84+)
  • @react-navigation/{native,stack,bottom-tabs}: 6.x → 7.x (required by screens 4.25 + Fabric)
  • @react-navigation/elements: 1.x → 2.x
  • @react-native-community/slider: 4.5.7 → 5.2.0 (required for storybook bundle on RN 0.85)
  • @react-native/{babel,jest,codegen,metro-config}-preset: 0.76.x → 0.85.3
  • @types/react: ^19.2.15
  • @breeztech/breez-sdk-spark-react-native: 0.13.2-dev3 → 0.15.0 (16 KB page-size compliance + real-time TokenTransactionEvent)
  • Gradle: 8.10.2 → 8.13, compileSdkVersion 35 → 36

Notable changes by area

iOS build

  • Build React-Core from source (RCT_USE_PREBUILT_RNCORE=0) until RNFirebase supports the prebuilt binary (RN 0.84+)
  • Downgrade non-modular include errors to warnings for all pod targets (use_frameworks! + static linkage)
  • Register RCTAppDependencyProvider in AppDelegate so Fabric discovers third-party native components at runtime
  • Patch react-native-camera-kit iOS 26 deferred-start APIs behind #if compiler(>=6.2) for pre-Xcode 26 compatibility

Android build

  • Gradle 8.13 + compileSdk 36 (targetSdk stays at 35)
  • Jest config switched to @react-native/jest-preset + worklets resolver

Source adaptations

  • StyleSheet.absoluteFillObjectabsoluteFill (removed in 0.85)
  • tabBarTestIDtabBarButtonTestID (renamed in bottom-tabs v7)
  • ViewShot ref typed as ViewShotRef (react-native-view-shot v5)
  • reanimated v4 native API migration in galoy-slider-button (Gesture.Pan, runOnJS in worklet) and pagination-item (SharedValue import path)
  • React 19 stricter useRef / RefObject typings adapted in use-clipboard, use-geetest-captcha, amount-input-modal, use-screenshot, use-receive-carousel, header-back-control
  • @rn-vui/themed Input ref bug worked around with new InputRef type at app/types/themed-input.ts (linked open issues in code)
  • useDeviceColorScheme() now guards the unspecified value React Native 0.85 surfaces (theme fallback)
  • use-conversion-overlay-focus ref param narrowed to a focusable interface so test mocks no longer need an as unknown as InputRef cast

Amount input modal

  • Replaced @gorhom/bottom-sheet with React Native's built-in Modal for this screen. The library silently fails to render under reanimated v4 + RN 0.85; the upstream rework targeting that combo is open but not merged (refs in the modal file). Will switch back once gorhom v6 ships. Trade-off: lose the swipe-down gesture (tap-on-backdrop closes instead).

Self-custodial Receive — duplicate invoice guard

  • Fixed a latent race that generated the Lightning invoice twice on mount (visible flicker as the second replaced the first). Pre-existing in code but only became reliably noticeable after the React 19 upgrade, which shifted when usePriceConversion emits its first refresh — now lands mid-flight instead of before/after the SDK call. Fix: stabilise convertMoneyAmount via ref so generateRequest keeps its identity across price refreshes, plus a Loading guard against any future overlap. Regression test added.

Self-custodial Breez SDK upgrade (0.13.2-dev3 → 0.15.0)

  • Closes the 16 KB ELF alignment gap tracked in fix(android): Support 16 KB memory page sizes (Google Play deadline May 31, 2026) #3771: the Breez SDK shim binary (libbreeztech-breez-sdk-spark-react-native.so) was the single library shipping with 4 KB alignment, which fails Google Play's new 16 KB page-size requirement. Upstream fix in breez/spark-sdk#814 (merged 2026-04-21) added the -Wl,-z,max-page-size=16384 linker flag. Verified post-bump via the official AOSP check_elf_alignment.sh script: all 36 libraries in arm64-v8a now report ALIGNED (2**14 = 16 KB).
  • Brings the real-time TokenTransactionEvent (closes breez/spark-sdk#826), allowing the app to surface incoming token payments without forced syncs. The manual syncWallet workarounds previously needed to materialize token balances on receive/convert have been removed from use-sdk-lifecycle, use-auto-convert-listener, and the convert bridge, along with their assertion-level tests.

Self-custodial backup nudge — account-switch flash guard

  • Fixed a flash of the "Secure your funds" modal when switching between SC accounts (the destination account's modal-eligibility was evaluated against the previous account's stale wallet state for ~1–2s). Pre-existing race surfaced by React 19 + RN 0.85 render scheduling. Two-part fix: (1) useSdkLifecycle now resets status to Loading and clears wallets synchronously the moment activeSelfCustodialAccountId changes, closing the stale-render window; (2) useBackupNudgeState gates modal/banner visibility behind activeWallet.isReady as defense in depth. Regression test added.

Tests

  • Updated mocks for testing-library 13 (Linking / AppState ESM shape, removed deprecated react-hooks import paths)
  • useDerivedValue and Reanimated.View mocks brought up to the v4 surface
  • Per-spec adaptations for the new dismiss-and-flush flow of the native modal
  • Test helper ContextForScreen defaults to headerShown: false (navigation v7 HeaderSearchBar requires full navigation context)
  • Added addListener to useNavigation mock in conversion-details-screen (required by navigation v7)
  • Polyfill window.dispatchEvent in auto-convert-listener-mount spec (React 19 error reporting)
  • receive.spec renders with headerShown enabled to preserve NFC header button tests

Dependencies

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@esaugomez31 esaugomez31 changed the title chore(deps): bump RN 0.76 to 0.85.3, React 19 and reanimated v4 stack refactor: upgrade React Native to 0.85.3 (React 19, reanimated v4) May 26, 2026
@esaugomez31 esaugomez31 changed the title refactor: upgrade React Native to 0.85.3 (React 19, reanimated v4) refactor: upgrade React Native to 0.85.3 (React 19) May 26, 2026
@esaugomez31 esaugomez31 self-assigned this May 26, 2026
@esaugomez31 esaugomez31 force-pushed the refactor--upgrade-react-native branch 4 times, most recently from 54a7745 to ad9964e Compare May 27, 2026 13:02
@esaugomez31 esaugomez31 marked this pull request as ready for review May 27, 2026 13:23
@esaugomez31 esaugomez31 requested a review from grimen May 27, 2026 15:35
grimen
grimen previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@grimen grimen left a comment

Choose a reason for hiding this comment

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

LGTM

- @react-navigation/native 6.x → 7.x
- @react-navigation/stack 6.x → 7.x
- @react-navigation/bottom-tabs 6.x → 7.x
- @react-navigation/elements 1.x → 2.x
- react-native-svg 15.8.0 → 15.15.5
- react-native-view-shot 4.x → 5.x
- Build React-Core from source (RCT_USE_PREBUILT_RNCORE=0) to fix
  RNFirebase static framework imports with prebuilt binary (RN 0.84+)
- Downgrade non-modular include errors to warnings for all pod targets
  (use_frameworks! + static linkage sets DEFINES_MODULE=YES)
- Register RCTAppDependencyProvider so Fabric can discover third-party
  native components (screens, safe-area, svg, etc.) at runtime
@esaugomez31 esaugomez31 force-pushed the refactor--upgrade-react-native branch from e642732 to 37033e7 Compare May 27, 2026 22:07
@grimen grimen merged commit 901538e into main May 27, 2026
7 of 9 checks passed
@grimen grimen deleted the refactor--upgrade-react-native branch May 27, 2026 22:53
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.

Detect incoming token payments in real time

2 participants