File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1- import { createFileRoute } from "@tanstack/react-router" ;
1+ import { createFileRoute , ParsedLocation } from "@tanstack/react-router" ;
22import { fetchMDXCode , fetchSingleMDXFrontMatter } from "~/utils/mdx-fetcher" ;
33import { MDXPost } from "~/components/page" ;
44
5+ let prevLoc : ParsedLocation | null = null ;
6+
57export const Route = createFileRoute ( "/about-site" ) ( {
68 loader : async ( ) => {
79 return {
@@ -14,6 +16,22 @@ export const Route = createFileRoute("/about-site")({
1416 } ;
1517 } ,
1618 component : AboutComponent ,
19+ shouldReload ( match ) {
20+ try {
21+ if ( match . cause === "enter" || match . cause === "preload" ) return true ;
22+
23+ const hashOnly =
24+ prevLoc &&
25+ prevLoc . pathname === match . location . pathname &&
26+ prevLoc . searchStr === match . location . searchStr ;
27+
28+ if ( hashOnly ) return false ;
29+
30+ return true ;
31+ } finally {
32+ prevLoc = match . location ;
33+ }
34+ } ,
1735} ) ;
1836
1937function AboutComponent ( ) {
You can’t perform that action at this time.
0 commit comments