Skip to content

Commit

Permalink
fix(gatsby-script): Reach router import (#36385)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4c752d1)
  • Loading branch information
tyhopp authored and marvinjude committed Aug 16, 2022
1 parent f664ad2 commit 5f0b9ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/gatsby-script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"typescript": "^4.7.4"
},
"peerDependencies": {
"@gatsbyjs/reach-router": "^1.3.5",
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/gatsby-script/src/gatsby-script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React, { useEffect } from "react"
import { collectedScriptsByPage } from "./collected-scripts-by-page"
import type { ReactElement, ScriptHTMLAttributes } from "react"
import { requestIdleCallback } from "./request-idle-callback-shim"

// For some reason @gatsbyjs/reach-router does not resolve the same module that core uses, but this does
import { Location, useLocation } from "@reach/router"
import { Location, useLocation } from "@gatsbyjs/reach-router"

export enum ScriptStrategy {
postHydrate = `post-hydrate`,
Expand Down

0 comments on commit 5f0b9ff

Please sign in to comment.