API Reference
Complete API documentation for @funstack/router. Select a category above or browse below.
Components
Core components for building routing in your React application.
<Router>— The main router component that provides routing context<Outlet>— Renders child route components for nested layouts
Hooks
React hooks for accessing router state and navigation.
useLocation()— Current location objectuseSearchParams()— Search query managementuseBlocker()— Prevent navigation away from current routeuseRouteParams()— Type-safe route parametersuseRouteState()— Type-safe navigation stateuseRouteData()— Type-safe loader datauseIsPending()— Navigation transition pending state
Utilities
Helper functions for defining routes and managing state.
route()— Route definition helper with type inferencerouteState()— Typed navigation state managementhardReload()— Full page reload bypassing the routerhardNavigate()— Full page navigation bypassing the router
Types
TypeScript types and interfaces exported by the router.
RouteComponentProps— Props type for route componentsRouteComponentPropsWithData— Props type with loader dataPathParams— Extract parameters from path patternsTypefulOpaqueRouteDefinition— Type-safe route definitionExtractRouteId,ExtractRouteParams,ExtractRouteState,ExtractRouteData— Type extraction utilitiesRouteDefinition,ActionArgs,LoaderArgs,Location,NavigateOptions