Package-level declarations

Types

Link copied to clipboard
external interface ActiveLinkOptionProps
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface BlockerResolverStatus
Link copied to clipboard
external interface ErrorComponentProps : Props
Link copied to clipboard
external interface HasBlockerResolverStatus
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface NotFoundRouteProps : Props
Link copied to clipboard
external class RootRoute : BaseRootRoute<Route>
Link copied to clipboard
Link copied to clipboard
external class Route : BaseRoute<Route>
Link copied to clipboard
Link copied to clipboard
external interface RouteMatch : RouteMatch
Link copied to clipboard
Link copied to clipboard
external class Router : RouterCore
Link copied to clipboard
external interface RouterOptions : RouterOptions<RootRoute>
Link copied to clipboard
external interface RouterProviderProps : Props
Link copied to clipboard
typealias Select<T, R> = (T) -> R
Link copied to clipboard
Link copied to clipboard
external interface ShouldBlockFnArgs
Link copied to clipboard
external interface ShouldBlockFnLocation
Link copied to clipboard
Link copied to clipboard
external interface UseMatchRouteOptions : ToOptions
Link copied to clipboard

Properties

Link copied to clipboard
external val Link: FC<LinkComponentProps>

A strongly-typed anchor component for declarative navigation. Handles path, search, hash and state updates with optional route preloading and active-state styling.

Link copied to clipboard

Render the next child match in the route tree. Typically used inside a route component to render nested routes.

Link copied to clipboard

Top-level component that renders the active route matches and provides the router to the React tree via context.

Functions

Link copied to clipboard
external fun createRootRoute(options: RootRouteOptions = definedExternally): RootRoute

Creates a root Route instance used to build your route tree.

Link copied to clipboard
external fun createRoute(options: RouteOptions): Route

Creates a non-root Route instance for code-based routing.

Link copied to clipboard
external fun createRouter(options: RouterOptions): Router

Creates a new Router instance for React.

Link copied to clipboard
fun useBlocker(shouldBlockFn: ShouldBlockFn)
fun useBlocker(shouldBlockFn: ShouldBlockFn, enableBeforeUnload: () -> Boolean? = undefined, disabled: Boolean? = undefined)
Link copied to clipboard
fun useBlockerResolver(shouldBlockFn: ShouldBlockFn, enableBeforeUnload: () -> Boolean? = undefined, disabled: Boolean? = undefined): BlockerResolver?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external fun useLocation(): ParsedLocation

Read the current location from the router state with optional selection. Useful for subscribing to just the pieces of location you care about.

fun <T> useLocation(select: Select<ParsedLocation, T>): T
fun <T> useLocation(select: Select<ParsedLocation, T>, structuralSharing: Boolean): T
Link copied to clipboard

Create a matcher function for testing locations against route definitions.

Link copied to clipboard

Imperative navigation hook.

Link copied to clipboard
fun <T> useParams(select: Select<Params, T>): T
Link copied to clipboard
external fun useRouter(): Router

Access the current TanStack Router instance from React context. Must be used within a RouterProvider.

Link copied to clipboard
fun <T> useSearch(select: Select<Search, T>): T