[]previous and next page

RouteErrorProps

Props passed to a route error component.

Props passed to a route error component.

Import#

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

Signature#

ts
interface RouteErrorProps {
  /** The thrown value. */
  readonly error: unknown;
  /**
   * Clears the error and rebuilds the route's content, without loading its data again. Also called automatically
   * on the next navigation. Use it when the route's render failed and its data is fine.
   */
  readonly reset: () => void;
  /**
   * Revalidates the route's loader (its cached data is dropped and loaded again), then clears the error and rebuilds
   * the route, as `reset` does. Use it when the route's data failed to load.
   */
  readonly retry: () => void;
}

Members#

Name Type Description
error readonly error: unknown The thrown value.
reset readonly reset: () => void Clears the error and rebuilds the route's content, without loading its data again. Also called automatically on the next navigation. Use it when the route's render failed and its data is fine.
retry readonly retry: () => void Revalidates the route's loader (its cached data is dropped and loaded again), then clears the error and rebuilds the route, as reset does. Use it when the route's data failed to load.