import { action, revalidate, redirect } from "@solidjs/router" // anywhere const myAction = action(async (data) => { await doMutation(data); throw redirect("/", { revalidate: getUser.keyFor(data.id) }); // throw a response to do a redirect }); // in component //or Actions ...
import type { RouterResponseInit, CustomResponse } from "../types"; export function redirect(url: string, init: number | RouterResponseInit = 302) { let responseInit: ResponseInit; Expand All @@ -21,7 +21,7 @@ export function redirect(url: string, init: number | RouterResponseInit = ...
// client-only absolute redirect (possibly cross-origin) else if (!isServer && url) window.location.href = url; // server-only absolute redirects are handled on the client else if (isServer) returnEarly = false; if (returnEarly) return; } if ((v as any).customBody) v = await (v...
1 1 import { IonRoute, IonRouteRedirect, IonRouter } from '@ionic-solidjs/core'; 2 - import type { ComponentRefProps } from '@ionic-solidjs/core/src'; 2 + import type { ComponentRefProps } from '@ionic-solidjs/core'; 3 3 import type { JSX as IonicJSX } from '@ionic/...
export { redirect, reload, json } from "./response.js";9 changes: 7 additions & 2 deletions 9 src/lifecycle.ts Original file line numberDiff line numberDiff line change @@ -1,5 +1,10 @@ import { isServer } from "solid-js/web"; import { BeforeLeaveLifecycle, BeforeLeaveListener,...
ion-route-redirect.tsx ion-router-link.tsx ion-router-outlet.tsx ion-row.tsx ion-searchbar.tsx ion-segment-button.tsx ion-segment.tsx ion-select-option.tsx ion-select-popover.tsx ion-select.tsx ion-skeleton-text.tsx ion-spinner.tsx ion-split-pane.tsx ion-tab-bar.tsx ion-tab-button.ts...
By default this this is implemented with `window.history.replace` and is exposed // to isolate browser API dependencies and give you and integration point to your router. onLogin?: (appState: any, loginRedirectUri: string) => void; // Children children: JSX.Children; }...
interfaceRedirectProps{// Path to redirect to. Relative hrefs will be resolved in the same way as a Link component except// absolute hrefs will throw an error.href:string;} Integrations Integration between the router and external systems such as the browser. This can be a simple signal with...