React Native
Native rendering and UI-thread playback use the same matching and physics concepts, with native fade/slide presets. This native integration remains experimental.
Common setup
Use @ssgoi/react-native for the provider and native presets. Web transition presets and DOM attributes do not apply to native views.
import { Ssgoi, type SsgoiConfig } from "@ssgoi/react-native";
import { slide } from "@ssgoi/react-native/view-transitions";Expo Router
Experimental APIPass Expo Router’s StackRouter and unstable_integrateWithRouter as framework. The file-based boundary discovers screens and retains outgoing native views until playback completes. It replaces the Stack in that layout.
Run the source example
The template pins Expo 56.0.21, Expo Router 56.2.20, React Native 0.85.3, React 19.2.3, Reanimated 4.3.1 and Worklets 0.8.3. The Expo standard navigator API is alpha. Use a matching Expo Go build or development build.
pnpm install
pnpm --filter @ssgoi/core build
pnpm --filter @ssgoi/react-native build
pnpm --filter ssgoi-expo-template startProvider and file-based route boundary
Create page files normally and keep using Expo Link and router.push/replace/back. Keep framework at module scope so the navigator is built once; SsgoiLayoutBoundary throws if <Ssgoi> has no framework. The boundary supplies one native surface per screen and retains outgoing instances until animation completion. It replaces the layout navigator; do not wrap an existing Stack or Slot inside it. The app supplies safe areas and screen backgrounds.
// app/_layout.tsx
import { StackRouter, unstable_integrateWithRouter } from "expo-router";
import {
Ssgoi,
SsgoiLayoutBoundary,
type SsgoiConfig,
} from "@ssgoi/react-native";
import { slide } from "@ssgoi/react-native/view-transitions";
const config = {
transitions: [{ from: "/posts", to: "/posts/*", transition: slide() }],
} satisfies SsgoiConfig;
const framework = { StackRouter, unstable_integrateWithRouter };
export default function Layout() {
return (
<Ssgoi config={config} framework={framework}>
<SsgoiLayoutBoundary />
</Ssgoi>
);
}Configuration and scope
Route rules and middleware share the web semantics. The native provider selects Reanimated playback automatically. Each screen keeps its own native instance, so pushed screens stay separate. Mounted screens preserve input and scroll state. Explicit scroll restoration is rejected. config.layouts is accepted but has no effect on native stacks: every push is its own screen, and Expo nested navigators handle grouping, so use one root boundary. The preview targets one iOS/Android stack with fade/slide; headers, modal presentation, interactive gestures, shared elements, nested navigator coordination, and Expo Web are follow-up work.
Verify on devices
The tests use real Expo Router with native mocks and a controlled frame clock. Type checks and Hermes exports validate integration and building, not pixels or UI-thread performance. Check list/detail/back, retained inputs and scroll, replace, system reduced motion, rotation and background recovery on iOS and Android before production use.
Use native presets and verify behavior on devices. Web effects and DOM boundary setup do not apply unchanged to native views.