veryfront/router

Import

ts
import { Link, Router, RouterProvider, useRouter } from "veryfront/router";

Examples

tsx
import { Link, RouterProvider, useRouter } from "veryfront/router";

Exports

Components

NameDescriptionSource
LinkRenders an anchor element annotated for Veryfront prefetch handling.source
RouterProvides the router context. pathname/query track the live URL through the shared navigation store's useSyncExternalStore surface; params/domain are seeded from the router prop. One component serves both sides: React uses getServerSnapshot (the seed href) during SSR and the live store on the client, so there is no environment branch - the server render and the first client render match by construction.source
RouterProviderProvides the router context. pathname/query track the live URL through the shared navigation store's useSyncExternalStore surface; params/domain are seeded from the router prop. One component serves both sides: React uses getServerSnapshot (the seed href) during SSR and the live store on the client, so there is no environment branch - the server render and the first client render match by construction.source

Functions

NameDescriptionSource
useRouterReads the router context: pathname, query, params, and the navigation actions. Reactive across client-side navigation - this is the single hook for location and navigation state.source

Types

NameDescriptionSource
LinkPropsProps accepted by <Link>.source
RouterProviderPropsProps accepted by <RouterProvider>.source
RouterValueRouter state exposed through useRouter().source