Files
SnowLuma/.pnpm-store/v11/files/38/9285904a3e34b92b7921aff382cab70186464b0dac037ff5c128a0b35fa53e7eeec8e452f3e724da3c60cdbe4eba3e25856f1af4d609b2df3a3be09c78966d
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

1 line
1.6 KiB
Plaintext

{"version":3,"file":"ScrollRestoration.js","names":[],"sources":["../../src/ScrollRestoration.tsx"],"sourcesContent":["import {\n getElementScrollRestorationEntry,\n setupScrollRestoration,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n ParsedLocation,\n ScrollRestorationEntry,\n ScrollRestorationOptions,\n} from '@tanstack/router-core'\n\nfunction useScrollRestoration() {\n const router = useRouter()\n setupScrollRestoration(router, true)\n}\n\n/**\n * @deprecated Use the `scrollRestoration` router option instead.\n */\nexport function ScrollRestoration(_props: ScrollRestorationOptions) {\n useScrollRestoration()\n\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n \"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.\",\n )\n }\n\n return null\n}\n\nexport function useElementScrollRestoration(\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n useScrollRestoration()\n\n return getElementScrollRestorationEntry(useRouter(), options)\n}\n"],"mappings":";;;AAWA,SAAS,uBAAuB;AAE9B,wBADe,WAAW,EACK,KAAK;;;;;AAMtC,SAAgB,kBAAkB,QAAkC;AAClE,uBAAsB;AAEtB,KAAA,QAAA,IAAA,aAA6B,cAC3B,SAAQ,KACN,wGACD;AAGH,QAAO;;AAGT,SAAgB,4BACd,SAYoC;AACpC,uBAAsB;AAEtB,QAAO,iCAAiC,WAAW,EAAE,QAAQ"}