[]previous and next page

RouteArgs

What beforeLoad and loader receive for a route.

What beforeLoad and loader receive for a route.

Import#

ts
import type { RouteArgs } from "@shadow-js/router";

Signature#

ts
interface RouteArgs<P extends string, S> {
  readonly params: ParamsView<P>;
  /** The validated search of this route (the parsed record when there is no validator). */
  readonly search: S;
  /** Context from the root down to this route, excluding this route's own additions. */
  readonly context: Readonly<Record<string, unknown>>;
  readonly location: RouteLocation;
  readonly intent: LoadIntent;
  /** Aborted when a newer navigation supersedes this one, or the router is disposed. */
  readonly signal: AbortSignal;
}

Members#

Name Type Description
P P extends string
S S
params readonly params: ParamsView<P>
search readonly search: S The validated search of this route (the parsed record when there is no validator).
context readonly context: Readonly<Record<string, unknown>> Context from the root down to this route, excluding this route's own additions.
location readonly location: RouteLocation
intent readonly intent: LoadIntent
signal readonly signal: AbortSignal Aborted when a newer navigation supersedes this one, or the router is disposed.