Skip to content

Commit

Permalink
fix(gatsby-script): Reach router import (#36385) (#36394)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4c752d1)

Co-authored-by: Ty Hopp <tyhopp@users.noreply.github.com>
  • Loading branch information
gatsbybot and tyhopp authored Aug 16, 2022
1 parent f664ad2 commit 1880491
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 1880491

Please sign in to comment.