Router
A Router instance manages all navigation and data loading/mutations
interface Router {
_internalActiveDeferreds: Map<string, DeferredData>;
_internalFetchControllers: Map<string, AbortController>;
get basename(): RouterInit["basename"];
createHref(location: Location | URL): string;
deleteFetcher(key?: string): void;
dispose(): void;
enableScrollRestoration(
savedScrollPositions: Record<string, number>,
getScrollPosition: GetScrollPositionFunction,
getKey?: GetScrollRestorationKeyFunction,
): () => void;initialize(): Router;
navigate(to: number): void;
revalidate(): void;
get routes(): AgnosticDataRouteObject[];
get state(): RouterState;
subscribe(fn: RouterSubscriber): () => void;
}§Properties
§
_internalActiveDeferreds: Map<string, DeferredData>
[src]§Methods
§
get basename(): RouterInit["basename"]
[src]§
enableScrollRestoration(
[src]savedScrollPositions: Record<string, number>,
getScrollPosition: GetScrollPositionFunction,
getKey?: GetScrollRestorationKeyFunction,
): () => void@param savedScrollPositions
Object that will manage positions, in case it's being restored from sessionStorage
@param getScrollPosition
Function to get the active Y scroll position
@param getKey
Function to get the key to use for restoration
§
@param key
Fetcher key
@param routeId
Route that owns the fetcher
@param href
href to fetch
@param opts
Fetcher options, (method, submission, etc.)
§
get routes(): AgnosticDataRouteObject[]
[src]§
get state(): RouterState
[src]§
subscribe(fn: RouterSubscriber): () => void
[src]@param fn
function to call with the new state