@tanstack/react-router
Advanced tools
Comparing version
import { AnyRouter, NonNullableUpdater, ParsedLocation } from '@tanstack/router-core'; | ||
import { RouterHistory } from '@tanstack/history'; | ||
export type ScrollRestorationEntry = { | ||
@@ -26,4 +27,4 @@ scrollX: number; | ||
export declare function getCssSelector(el: any): string; | ||
export declare function restoreScroll(storageKey: string, key?: string, behavior?: ScrollToOptions['behavior'], shouldScrollRestoration?: boolean, scrollToTopSelectors?: Array<string>): void; | ||
export declare function restoreScroll(routerHistory: RouterHistory, storageKey: string, key?: string, behavior?: ScrollToOptions['behavior'], shouldScrollRestoration?: boolean, scrollToTopSelectors?: Array<string>): void; | ||
export declare function setupScrollRestoration(router: AnyRouter, force?: boolean): void; | ||
export declare function ScrollRestoration(): import("react/jsx-runtime").JSX.Element | null; |
@@ -51,3 +51,3 @@ import { jsx } from "react/jsx-runtime"; | ||
let ignoreScroll = false; | ||
function restoreScroll(storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors) { | ||
function restoreScroll(routerHistory, storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors) { | ||
var _a; | ||
@@ -84,3 +84,3 @@ let byKey; | ||
} | ||
const hash = window.location.hash.split("#")[1]; | ||
const hash = routerHistory.location.hash.split("#")[1]; | ||
if (hash) { | ||
@@ -168,2 +168,3 @@ const hashScrollIntoViewOptions = (window.history.state || {}).__hashScrollIntoViewOptions ?? true; | ||
restoreScroll( | ||
router.history, | ||
storageKey, | ||
@@ -170,0 +171,0 @@ cacheKey, |
{ | ||
"name": "@tanstack/react-router", | ||
"version": "1.114.1", | ||
"version": "1.114.2", | ||
"description": "Modern and scalable routing for React applications", | ||
@@ -56,4 +56,4 @@ "author": "Tanner Linsley", | ||
"tiny-warning": "^1.0.3", | ||
"@tanstack/router-core": "^1.114.1", | ||
"@tanstack/history": "1.114.1" | ||
"@tanstack/history": "1.114.1", | ||
"@tanstack/router-core": "^1.114.1" | ||
}, | ||
@@ -60,0 +60,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1268205
0.05%16722
0.04%