Skip to content

Commit 1880491

Browse files
gatsbybottyhopp
andauthored
fix(gatsby-script): Reach router import (#36385) (#36394)
(cherry picked from commit 4c752d1) Co-authored-by: Ty Hopp <tyhopp@users.noreply.github.com>
1 parent f664ad2 commit 1880491

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/gatsby-script/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"typescript": "^4.7.4"
2929
},
3030
"peerDependencies": {
31+
"@gatsbyjs/reach-router": "^1.3.5",
3132
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
3233
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
3334
},

packages/gatsby-script/src/gatsby-script.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import React, { useEffect } from "react"
22
import { collectedScriptsByPage } from "./collected-scripts-by-page"
33
import type { ReactElement, ScriptHTMLAttributes } from "react"
44
import { requestIdleCallback } from "./request-idle-callback-shim"
5-
6-
// For some reason @gatsbyjs/reach-router does not resolve the same module that core uses, but this does
7-
import { Location, useLocation } from "@reach/router"
5+
import { Location, useLocation } from "@gatsbyjs/reach-router"
86

97
export enum ScriptStrategy {
108
postHydrate = `post-hydrate`,

0 commit comments

Comments
 (0)