diff --git a/.changeset/soft-swans-swim.md b/.changeset/soft-swans-swim.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/soft-swans-swim.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/clerk-js/src/ui.retheme/router/PathRouter.tsx b/packages/clerk-js/src/ui.retheme/router/PathRouter.tsx index bbb951e035..c9211cd158 100644 --- a/packages/clerk-js/src/ui.retheme/router/PathRouter.tsx +++ b/packages/clerk-js/src/ui.retheme/router/PathRouter.tsx @@ -1,3 +1,4 @@ +import type { NavigateOptions } from '@clerk/types'; import React from 'react'; import { hasUrlInFragment, mergeFragmentIntoUrl, stripOrigin } from '../../utils'; @@ -18,12 +19,12 @@ export const PathRouter = ({ basePath, preservedParams, children }: PathRouterPr throw new Error('Clerk: Missing navigate option.'); } - const internalNavigate = (toURL: URL | string | undefined) => { + const internalNavigate = (toURL: URL | string | undefined, options?: NavigateOptions) => { if (!toURL) { return; } // Only send the path - return navigate(stripOrigin(toURL)); + return navigate(stripOrigin(toURL), options); }; const getPath = () => { @@ -38,7 +39,7 @@ export const PathRouter = ({ basePath, preservedParams, children }: PathRouterPr const convertHashToPath = async () => { if (hasUrlInFragment(window.location.hash)) { const url = mergeFragmentIntoUrl(new URL(window.location.href)); - await internalNavigate(url.href); + await internalNavigate(url.href, { replace: true }); setStripped(true); } };