Import
import { Link, Router, RouterProvider, useRouter } from "veryfront/router";
Examples
import { Link, RouterProvider, useRouter } from "veryfront/router";
Exports
Components
| Name | Description | Source |
|---|---|---|
Link | Renders an anchor element annotated for Veryfront prefetch handling. | source |
Router | Provides 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 |
RouterProvider | Provides 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
| Name | Description | Source |
|---|---|---|
useRouter | Reads 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 |