Skip to content

Commit

Permalink
chore: adjust all @reach/router imports to not rely just on webpack a…
Browse files Browse the repository at this point in the history
…lias (#30033) (#30049)

(cherry picked from commit 38dab68)

Co-authored-by: Michal Piechowiak <[email protected]>
  • Loading branch information
GatsbyJS Bot and pieh authored Mar 5, 2021
1 parent 1939967 commit 8686a42
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-link/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from "prop-types"
import React from "react"
import { Link, Location } from "@reach/router"
import { Link, Location } from "@gatsbyjs/reach-router"
import { resolve } from "@gatsbyjs/reach-router/lib/utils"

import { parsePath } from "./parse-path"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-react-router-scroll/src/scroll-handler.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { LocationContext } from "@reach/router"
import { LocationContext } from "@gatsbyjs/reach-router"
import PropTypes from "prop-types"
import { SessionStorage } from "./session-storage"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ScrollContext } from "./scroll-handler"
import { useRef, useContext, useLayoutEffect, MutableRefObject } from "react"
import { useLocation } from "@reach/router"
import { useLocation } from "@gatsbyjs/reach-router"

interface IScrollRestorationProps {
ref: MutableRefObject<HTMLElement | undefined>
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/cache-dir/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import redirects from "./redirects.json"
import { apiRunner } from "./api-runner-browser"
import emitter from "./emitter"
import { RouteAnnouncerProps } from "./route-announcer-props"
import { navigate as reachNavigate } from "@reach/router"
import { globalHistory } from "@reach/router/lib/history"
import { navigate as reachNavigate } from "@gatsbyjs/reach-router"
import { globalHistory } from "@gatsbyjs/reach-router/lib/history"
import { parsePath } from "gatsby-link"

// Convert to a map for faster lookup in maybeRedirect()
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/cache-dir/production-app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { apiRunner, apiRunnerAsync } from "./api-runner-browser"
import React from "react"
import ReactDOM from "react-dom"
import { Router, navigate, Location, BaseContext } from "@reach/router"
import { Router, navigate, Location, BaseContext } from "@gatsbyjs/reach-router"
import { ScrollContext } from "gatsby-react-router-scroll"
import domReady from "@mikaelkristiansson/domready"
import { StaticQueryContext } from "gatsby"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/cache-dir/root.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Router, Location, BaseContext } from "@reach/router"
import { Router, Location, BaseContext } from "@gatsbyjs/reach-router"
import { ScrollContext } from "gatsby-react-router-scroll"

import { shouldUpdateScroll, RouteUpdates } from "./navigation"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/cache-dir/static-entry.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const React = require(`react`)
const path = require(`path`)
const { renderToString, renderToStaticMarkup } = require(`react-dom/server`)
const { ServerLocation, Router, isRedirect } = require(`@reach/router`)
const { ServerLocation, Router, isRedirect } = require(`@gatsbyjs/reach-router`)
const { merge, flattenDeep, replace } = require(`lodash`)
const { StaticQueryContext } = require(`gatsby`)
const fs = require(`fs`)
Expand Down

0 comments on commit 8686a42

Please sign in to comment.