Routing and navigation for Lynx apps, built on React Navigation.
Documentation lives in the @react-navigation/lynx README.
| Name | Latest Version |
|---|---|
| @react-navigation/lynx |
The stack navigator renders through
lynx-screens, a peer
dependency that is published under the next tag for now:
.
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.
-
Build and launch
lynx-screens/LynxExampleon Android or iOS, following lynx-screens' getting started. -
Start the dev server:
git submodule update --init pnpm install pnpm turbo run dev --filter @react-navigation/example-stack
-
On the host's home screen, scan the QR code the dev server prints, or enter its URL.
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.
@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 bylynx-screens./react-compat- areactentry for@lynx-js/react0.126.0, whose own compat entry cannot runuseon the main thread
pnpm install
pnpm test
pnpm typecheckThe 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.
Licensed under the Apache License 2.0. Files ported from React Navigation keep their original MIT notice.