Files
SnowLuma/.pnpm-store/v11/files/aa/97dae26d44dbf86d0f00715598b6bd5d51cfc917f92f9f12cea683f75ee13489c5d1df99c3e52666dff85c8e47310e92a9a59b78290e3e07910bbd8aab07bb
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

22 lines
829 B
Plaintext

import { useRouter } from "./useRouter.js";
import { getElementScrollRestorationEntry, setupScrollRestoration } from "@tanstack/router-core";
//#region src/ScrollRestoration.tsx
function useScrollRestoration() {
setupScrollRestoration(useRouter(), true);
}
/**
* @deprecated Use the `scrollRestoration` router option instead.
*/
function ScrollRestoration(_props) {
useScrollRestoration();
if (process.env.NODE_ENV === "development") console.warn("The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.");
return null;
}
function useElementScrollRestoration(options) {
useScrollRestoration();
return getElementScrollRestorationEntry(useRouter(), options);
}
//#endregion
export { ScrollRestoration, useElementScrollRestoration };
//# sourceMappingURL=ScrollRestoration.js.map