Skip to content

Commit 7173f96

Browse files
andrewagainwardpeet
authored andcommitted
feat(gatsby): add prefetchPathname the public api (#13985)
1 parent 1b549e8 commit 7173f96

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/gatsby/cache-dir/gatsby-browser-entry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Link, {
1010
parsePath,
1111
} from "gatsby-link"
1212
import PageRenderer from "./public-page-renderer"
13+
import { enqueue as prefetchPathname } from "./loader"
1314

1415
const StaticQueryContext = React.createContext({})
1516

@@ -95,4 +96,5 @@ export {
9596
StaticQuery,
9697
PageRenderer,
9798
useStaticQuery,
99+
prefetchPathname,
98100
}

packages/gatsby/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export const useStaticQuery: <TData = any>(query: any) => TData
2323

2424
export const parsePath: (path: string) => WindowLocation
2525

26+
export const prefetchPathname: (path: string) => void
27+
2628
export interface PageRendererProps {
2729
location: WindowLocation
2830
}

0 commit comments

Comments
 (0)