Navigation is data: destinations are typed values; the Navigate intent
carries them. Hosts (browser history, React Navigation, desktop deep links)
sit below the adapter line.
import { IntentRef, Link, Text, makeNavigateIntent } from "@effect-native/core"
export const aboutDestination = { kind: "path" as const, path: "/about" }
export const aboutLink = Link(
{
key: "about-link",
destination: aboutDestination
},
[Text({ key: "about-link-label", content: "About", variant: "body" })]
)
export const goAbout = makeNavigateIntent(aboutDestination)
export const goHomeIntent = IntentRef("GoHome")destination.kind is one of url | path | anchor. Hosts handle Navigate;
apps can also keep a simple screen field in state (as the guide app does with
GoAbout / GoHome buttons) when no router is mounted yet.
- Provide a
NavigationHandlerLayer that calls the host router. - Register
navigationIntentDefinitions+makeNavigationIntentHandlers. - Optionally mirror host route changes back into state as intents.
examples/guide-app switches state.screen on GoAbout / GoHome.