React Routeways - API ReferenceDocs


React Routeways - API Reference / useRouteParams

Function: useRouteParams()

useRouteParams<T>(route): UseRouteParams<NonOptional<Parameters<T["makeUrl"]>[0]>>

Returns a tuple of a stateful value of both the path variables and query parameters, and a function to update them. Just like the useState hook would.

This hook uses both usePathVars and useQueryParameters, so updating parameters may have the same effects as in both hooks.

Type Parameters

T extends Routeway

Parameters

route: T

the Routeway route to use to parse the path variables and query parameters

Returns

UseRouteParams<NonOptional<Parameters<T["makeUrl"]>[0]>>

a stateful value of both the path variables and query parameters, and a function to update them

See

Defined in

src/lib/hooks/useRouteParams.hook.ts:31