Skip to content

feat[sdks][react-native]: support React 19 / New Architecture and run click actions on native taps - #4971

Open
kylefowler wants to merge 3 commits into
mainfrom
claude/react-native-architecture-1debe0
Open

kylefowler wants to merge 3 commits into
mainfrom
claude/react-native-architecture-1debe0

Conversation

@kylefowler

Copy link
Copy Markdown
Contributor

What

1. React 19 and the New Architecture on current React Native (3cb48b3)

  • Widen the react / react-dom peer range to ^18.0.0 || ^19.0.0. React Native 0.78+ requires React 19, and 0.82+ always runs on the New Architecture (Fabric + bridgeless).
  • Remove the unused react-native-video@5 dependency. It is end-of-life and legacy-architecture only, and the Video block was never registered in this SDK, so its override is now a stub.
  • Add packages/sdks/e2e/react-native-83-fabric: a native-only Expo SDK 55 / RN 0.83 / React 19.2 harness. It has a path picker, deep links (rn83fabric://<path>) and a fabric= bridgeless= hermes= readout. It is not wired into the Playwright CI matrix.

2. Click actions now run on native taps (fa7a3de)

  • On iOS and Android, React Native ignores onClick, and View has no tap handler, so Builder click actions never ran on native. Web already worked through RN Web.
  • The RN override of getEventHandlerName maps click to onPress on native.
  • A new getBlockTag helper makes blocks with a click action render as a Pressable instead of a View on native. It lives in src/functions so Mitosis can resolve it; only the RN override does anything, and other targets return undefined and don't use it.
  • In the harness, App.tsx passes a linkComponent, because RN ignores href on native, so link buttons never navigate without one. It also remounts <Content> per path so root data.state / jsCode are fresh.

Verified (iOS simulator, RN 0.83, Fabric + bridgeless + Hermes)

  • Mock pages render: /, /columns, symbols, data/state bindings, show/hide, accordion, tabs, A/B test, strict style mode.
  • State binding: tapping "Change Name" updates the bound text, and tapping a repeated item sets state.
  • /reactive-state: 3 taps give 3, so handlers don't fire twice.
  • Link buttons in the harness navigate between / and /columns.
  • yarn g:nx build @builder.io/sdk-react-native, yarn typecheck, eslint and prettier pass.

Not verified / for reviewers

  • The web e2e runs for react-native-74 / react-native-76-fabric have not been run locally. CI should cover them.
  • The old architecture has not been re-tested on native.
  • Other SDK outputs now import getBlockTag from block.lite.tsx but don't use it. Check that tree-shaking or lint in those outputs is happy.
  • Known follow-ups, not in this PR:
    • transform-block-properties.ts imports findDOMNode from react-dom, which React 19 removed. This only affects the editing path.
    • There is a nested VirtualizedList warning.
    • @builder.io/react-native-render-html's podspec uses a scoped name that CocoaPods rejects. The harness works around it in react-native.config.js.
  • Link blocks on native still need the app to pass linkComponent. The SDK has no native default.

🤖 Generated with Claude Code

kylefowler and others added 2 commits December 2, 2026 17:21
…n current RN

- widen `react`/`react-dom` peer range to `^18.0.0 || ^19.0.0` (RN 0.78+ requires React 19)
- drop the unused `react-native-video@5` dependency (EOL, legacy architecture only);
  the Video block was never registered on RN, so its override is now a stub
- add `e2e/react-native-83-fabric`, a native-only Expo SDK 55 / RN 0.83 harness
  (always Fabric + bridgeless) with a path picker, deep links and an arch readout
- work around `@builder.io/react-native-render-html`'s invalid scoped podspec name
  in the harness via `react-native.config.js` (Expo 54+ autolinks transitive deps)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On iOS and Android, React Native ignores `onClick`, and `View` has no tap
handler, so Builder click actions never ran on native (web was fine via RN Web).

- pass click actions as `onPress` on native (`getEventHandlerName` override)
- render blocks with a click action as a `Pressable` instead of a `View` on
  native (`getBlockTag`, used only by the RN SDK; other targets return undefined)
- harness: pass a `linkComponent` so link buttons (RN ignores `href` on native)
  open other mock pages; remount `<Content>` per path so root state is fresh

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ff20ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@builder.io/sdk-react-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud

nx-cloud Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 7ff20ef

Command Status Duration Result
nx test @e2e/react ✅ Succeeded 12m 53s View ↗
nx test @e2e/angular-17 ✅ Succeeded 8m 15s View ↗
nx test @e2e/qwik-city ✅ Succeeded 8m 4s View ↗
nx test @e2e/nextjs-sdk-next-app ✅ Succeeded 8m 5s View ↗
nx test @e2e/nuxt ✅ Succeeded 6m 48s View ↗
nx test @e2e/angular-17-ssr ✅ Succeeded 6m 25s View ↗
nx test @e2e/angular-19-ssr ✅ Succeeded 6m 28s View ↗
nx test @e2e/solid ✅ Succeeded 6m 18s View ↗
Additional runs (38) ✅ Succeeded ... View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-12-03 01:41:51 UTC

The SDK's tsconfig lists `react-native` in `types`, but `@types/react-native`
was only installed transitively through `@types/react-native-video`, which was
removed with `react-native-video`. The type build then failed with TS2688
("Cannot find type definition file for 'react-native'").

Pin it to 0.72.x, the line it resolved to before (0.73 is a deprecation stub).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Dec 3, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

This branch has not been deployed

No deployments
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