Skip to content

Repository files navigation

React Navigation for Lynx

CI npm Apache-2.0 licensed

Routing and navigation for Lynx apps, built on React Navigation.

Documentation lives in the @react-navigation/lynx README.

Package Versions

Name Latest Version
@react-navigation/lynx badge

The stack navigator renders through lynx-screens, a peer dependency that is published under the next tag for now: badge.

Example

examples/stack exercises the stack navigator, form sheets and deep linking. It needs a host app with the native side of lynx-screens linked in, so it runs inside the example app that ships with lynx-screens rather than in Lynx Explorer.

  1. Build and launch lynx-screens/LynxExample on Android or iOS, following lynx-screens' getting started.

  2. Start the dev server:

    git submodule update --init
    pnpm install
    pnpm turbo run dev --filter @react-navigation/example-stack
  3. On the host's home screen, scan the QR code the dev server prints, or enter its URL.

Layout

react-navigation/   git submodule - upstream React Navigation
lynx-screens/       git submodule - native screen primitives
packages/lynx/      @react-navigation/lynx
examples/stack/     example app

Both dependencies are vendored as submodules rather than consumed from npm. React Navigation 8 and lynx-screens are both moving quickly, and this package has to track them closely enough that waiting on releases would stall it.

Structure

@react-navigation/lynx mirrors what @react-navigation/native does for React Native: it is the platform layer, it re-exports core so apps have a single import surface, and navigators sit on top of it rather than on core directly.

  • . - platform layer
  • ./stack - stack navigator, backed by lynx-screens
  • ./react-compat - a react entry for @lynx-js/react 0.126.0, whose own compat entry cannot run use on the main thread

Development

pnpm install
pnpm test
pnpm typecheck

The vendored @react-navigation/core and @react-navigation/routers are consumed through their normal exports, like the published packages, so their lib/ has to exist: pnpm build:vendored builds it (turbo run prepack), and the turbo tasks depend on it, so pnpm typecheck, pnpm test, pnpm dev and pnpm build rebuild it whenever the submodules change.

typecheck reports diagnostics from the vendored sources but only fails on this package's own. Those sources are written against React's types while this package maps react onto ReactLynx, so inference inside them degrades; each submodule typechecks itself with its own config.

License

Licensed under the Apache License 2.0. Files ported from React Navigation keep their original MIT notice.

About

Routing and navigation for Lynx apps

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages