0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/examples/react/start-nativescript
History 2026-07-21 16:49:32 -06:00
..
App_Resources feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
e2e feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
src feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
.gitignore feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
nativescript.config.ts feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
package.json feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
README.md feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
tsconfig.json feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
vite.config.ts feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00
vite.native.config.ts feat: add NativeScript support for React Router and Start 2026-07-21 16:49:32 -06:00

TanStack Start + NativeScript

This example uses one generated route tree for a TanStack Start web app and a NativeScript React app. Route definitions, params, search validation, loaders, and server functions are shared. Web and NativeScript screen modules are paired with the *-native.tsx convention.

pnpm dev
pnpm native:ios
pnpm native:android

The native commands start the Start development server and the NativeScript debug build together. Production native builds run in release mode and must set TSS_SERVER_FN_BASE to the absolute HTTPS server-function endpoint. Android release builds also require NativeScript's four --key-store-* signing arguments.

NativeScript renders native Frame, Page, ActionBar, and layout views. It is not a WebView. iOS interactive swipe-back is provided by the native Page navigation stack. Each retained page renders from its own Router state snapshot, so its header, search params, loader data, and nested matches remain available during the gesture.

The web root route is replaced only in the native bundle. Imports such as screens/HomeScreen resolve to HomeScreen-native.tsx, while route and server modules stay shared. This is the intended migration boundary: DOM and CSS are not translated into NativeScript controls.

The stable NativeScript Vite 2 integration currently requires Vite 7. This example pins Vite 7.3.6 while the rest of the monorepo can use Vite 8.