[]previous and next page

RedirectSignal

Thrown (not returned) from beforeLoad or a loader to send the navigation elsewhere.

Thrown (not returned) from beforeLoad or a loader to send the navigation elsewhere. The object form of redirect keeps its target and builds to on first read, so the path and search builders are bundled only where a router or server reads it.

Import#

ts
import type { RedirectSignal } from "@shadow-js/dusk";

Signature#

ts
class RedirectSignal

Members#

Name Type Description
kind readonly kind: "redirect"
replace readonly replace: boolean
to get to(): string The target location.

Examples#

ts
import { RedirectSignal } from "@shadow-js/router/core";
new RedirectSignal("/login", true).to; // "/login"