Navigate
Navigates when it renders (in the browser).
Navigates when it renders (in the browser). Renders nothing. Use it for redirects that depend on
app state; for redirects that depend on the route, redirect() in beforeLoad is the tool.
Import#
ts
import { Navigate } from "@shadow-js/router";
Signature#
ts
function Navigate(props: NavigateProps): null
Parameters#
| Name | Description |
|---|---|
props |
to and the options of navigate. |
Returns#
null.
Examples#
ts
<Navigate to="/login" replace />