Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
experimental: navigate to dynamic path without reload (#2982)
Bogdan Chadkin7b629b690822
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsxindex 8e71b9f5d7..9a2014ab8f 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx@@ -96,8 +96,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set(["", "/script-test", "/world"]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsxindex b57be1b0d7..61a32a8a92 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx@@ -82,8 +82,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set(["", "/script-test", "/world"]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.tsxindex 5b58420ea3..3b98fa6c01 100644--- a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx@@ -124,8 +124,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set(["", "/script-test", "/world"]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsxindex 4eda646a7c..3a75a504e7 100644--- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsxindex 5d949e48ab..e9ab64282b 100644--- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsxindex 1d559bc0d1..74004fecf9 100644--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsxindex 0b7884cf3f..c6564f33a5 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx@@ -76,8 +76,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([""]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsxindex 1d559bc0d1..74004fecf9 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsxindex 0b7884cf3f..c6564f33a5 100644--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx@@ -76,8 +76,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([""]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsxindex 1d559bc0d1..74004fecf9 100644--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsxindex 973f96368e..a2d7d57d5d 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx@@ -107,16 +107,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsxindex 10aa32fd90..fbe7494037 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx@@ -220,16 +220,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsxindex 13cb382481..5d86f95067 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx@@ -108,16 +108,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsxindex 7852a733d8..ed26c19587 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx@@ -104,16 +104,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsxindex 1d68071954..596e91a951 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx@@ -255,16 +255,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsxindex 44cd43491c..d1d03aa7a0 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx@@ -116,16 +116,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsxindex 4bb120a77b..d18c61ca35 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx@@ -205,16 +205,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set([- "",- "/radix",- "/_route_with_symbols_",- "/form",- "/heading-with-id",- "/resources",- "/nested/nested-page",-]);-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsxindex ad9adde70f..8dd01c5712 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsxindex e58e461db4..bc45ac2a62 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsxindex 05e487e734..5bc492e29e 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsxindex f4c73bd324..21c102b8ed 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsxindex 85447c91fc..0af13347ff 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsxindex cfbd3e39d3..074f6af39e 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsxindex 1d559bc0d1..74004fecf9 100644--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/packages/cli/__generated__/_index.tsx b/packages/cli/__generated__/_index.tsxindex dbb9fa0565..036a5aa714 100644--- a/packages/cli/__generated__/_index.tsx+++ b/packages/cli/__generated__/_index.tsx@@ -41,8 +41,6 @@ export const getRemixParams = ({ ...params }: Params): Params => {return params;};-export const pagesPaths = new Set<string>();-export const formsProperties = new Map<string,{ method?: string; action?: string }diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.tsindex 6e6ab26c95..03131b6a21 100644--- a/packages/cli/src/prebuild.ts+++ b/packages/cli/src/prebuild.ts@@ -581,10 +581,7 @@ export const prebuild = async (options: {const props = new Map(pageData.build.props);const dataSources = new Map(pageData.build.dataSources);const resources = new Map(pageData.build.resources);- const utilsExport = generateUtilsExport({- pages: siteData.build.pages,- props,- });+ const utilsExport = generateUtilsExport({ props });// generate new Page Params variable if does not exist// to allow always passing it from route templateconst pathParamsDataSourceId =diff --git a/packages/cli/templates/defaults/__templates__/route-template.tsx b/packages/cli/templates/defaults/__templates__/route-template.tsxindex cfb66de0e1..864c89b5d7 100644--- a/packages/cli/templates/defaults/__templates__/route-template.tsx+++ b/packages/cli/templates/defaults/__templates__/route-template.tsx@@ -17,7 +17,6 @@ import {pageData,user,projectId,- pagesPaths,formsProperties,Page,imageAssets,@@ -324,7 +323,6 @@ const Outlet = () => {imageLoader,assetBaseUrl,imageBaseUrl,- pagesPaths,resources,}}>diff --git a/packages/react-sdk/src/context.tsx b/packages/react-sdk/src/context.tsxindex 32b0b65ae2..cc6e47bd72 100644--- a/packages/react-sdk/src/context.tsx+++ b/packages/react-sdk/src/context.tsx@@ -1,5 +1,4 @@import { createContext, useContext } from "react";-import type { Page } from "@webstudio-is/sdk";import type { ImageLoader } from "@webstudio-is/image";export type Params = {@@ -32,12 +31,6 @@ export type Params = {export const ReactSdkContext = createContext<Params & {imageLoader: ImageLoader;- /**- * List of pages paths for link component- * to navigate without reloading on published sites- * always empty for builder which handle anchor clicks globally- */- pagesPaths: Set<Page["path"]>;// resources need to be any to support accessing unknown fields without extra checks// eslint-disable-next-line @typescript-eslint/no-explicit-anyresources: Record<string, any>;@@ -46,7 +39,6 @@ export const ReactSdkContext = createContext<assetBaseUrl: "/",imageBaseUrl: "/",imageLoader: ({ src }) => src,- pagesPaths: new Set(),resources: {},});diff --git a/packages/react-sdk/src/generator.test.ts b/packages/react-sdk/src/generator.test.tsindex 774585b8ce..ae1f91925e 100644--- a/packages/react-sdk/src/generator.test.ts+++ b/packages/react-sdk/src/generator.test.ts@@ -1,35 +1,9 @@import { expect, test } from "@jest/globals";import { generateUtilsExport } from "./generator";-const createPage = (path: string) => ({- id: path,- path,- name: "",- title: "",- rootInstanceId: "",- meta: {},-});--const pages = {- meta: {},- pages: [],- folders: [- {- id: "root",- name: "Root",- slug: "",- children: [],- },- ],-};-test("generates forms properties", () => {expect(generateUtilsExport({- pages: {- ...pages,- homePage: createPage("1"),- },props: new Map([["method1Id",@@ -66,29 +40,20 @@ test("generates forms properties", () => {]),})).toMatchInlineSnapshot(`+"+ export const formsProperties = new Map<string, { method?: string, action?: string }>([["1",{"method":"post"}],["2",{"method":"get","action":"/index.php"}]])"- export const pagesPaths = new Set(["1"])-- export const formsProperties = new Map<string, { method?: string, action?: string }>([["1",{"method":"post"}],["2",{"method":"get","action":"/index.php"}]])- "- `);+`);});test("generates list of pages paths", () => {expect(generateUtilsExport({- pages: {- ...pages,- homePage: createPage("/path1"),- pages: [createPage("/path2"), createPage("/path3")],- },props: new Map(),})).toMatchInlineSnapshot(`+"+ export const formsProperties = new Map<string, { method?: string, action?: string }>([])"- export const pagesPaths = new Set(["/path1","/path2","/path3"])-- export const formsProperties = new Map<string, { method?: string, action?: string }>([])- "- `);+`);});diff --git a/packages/react-sdk/src/generator.ts b/packages/react-sdk/src/generator.tsindex e3c219a83a..2d29dca63b 100644--- a/packages/react-sdk/src/generator.ts+++ b/packages/react-sdk/src/generator.ts@@ -1,7 +1,6 @@-import { getPagePath, type Pages, type Props } from "@webstudio-is/sdk";+import type { Props } from "@webstudio-is/sdk";type PageData = {- pages: Pages;props: Props;};@@ -9,18 +8,6 @@ type PageData = {* Generates data based utilities at build time*/export const generateUtilsExport = (siteData: PageData) => {- // list of paths from pages to use framework link component- // for ui routes- const pagesPaths: string[] = [siteData.pages.homePage.path];- for (const page of siteData.pages.pages) {- const path = getPagePath(page.id, siteData.pages);- pagesPaths.push(path);- }-- const generatedPagesPaths = `export const pagesPaths = new Set(${JSON.stringify(- pagesPaths- )})`;-// method and action per instance extracted from propsconst formsProperties = new Map<string,@@ -43,8 +30,6 @@ export const generateUtilsExport = (siteData: PageData) => {)})`;return `- ${generatedPagesPaths}-${generatedFormsProperties}`;};diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsxindex 8ba88019f1..fdb822b910 100644--- a/packages/react-sdk/src/tree/create-elements-tree.tsx+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx@@ -53,7 +53,6 @@ export const createElementsTree = ({value={{renderer,imageLoader,- pagesPaths: new Set(),assetBaseUrl,imageBaseUrl,resources: {},diff --git a/packages/sdk-components-react-remix/src/shared/remix-link.tsx b/packages/sdk-components-react-remix/src/shared/remix-link.tsxindex 5235e4f28d..3d0f52bb19 100644--- a/packages/sdk-components-react-remix/src/shared/remix-link.tsx+++ b/packages/sdk-components-react-remix/src/shared/remix-link.tsx@@ -16,15 +16,16 @@ type Props = Omit<ComponentPropsWithoutRef<typeof Link>, "target"> & {export const wrapLinkComponent = (BaseLink: typeof Link) => {const Component = forwardRef<HTMLAnchorElement, Props>((props, ref) => {- const { pagesPaths } = useContext(ReactSdkContext);+ const { assetBaseUrl } = useContext(ReactSdkContext);const href = props.href;- // use remix link when url references webstudio page- if (href !== undefined) {- const url = new URL(href, "https://any-valid.url");- if (pagesPaths.has(url.pathname === "/" ? "" : url.pathname)) {- return <RemixLink {...props} to={href} ref={ref} />;- }+ // use remix link for home page and all relative urls+ // ignore asset paths which can be relative too+ if (+ href === "" ||+ (href?.startsWith("/") && href.startsWith(assetBaseUrl) === false)+ ) {+ return <RemixLink {...props} to={href} ref={ref} />;}const { prefetch, reloadDocument, replace, preventScrollReset, ...rest } =