diff --git a/src/app/App.js b/src/app/App.js index 16b13ad..03b37a9 100644 --- a/src/app/App.js +++ b/src/app/App.js @@ -3,7 +3,12 @@ import { ApolloProvider } from "@apollo/client"; import { Auth0Provider } from "@auth0/auth0-react"; import { CSSReset, ChakraProvider } from "@chakra-ui/core"; import defaultTheme from "@chakra-ui/theme"; -import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; +import { + BrowserRouter as Router, + Switch, + Route, + useLocation, +} from "react-router-dom"; import loadable from "@loadable/component"; import { useAuth0 } from "@auth0/auth0-react"; @@ -53,6 +58,7 @@ const theme = { function App() { return ( + window.scrollTo(0, 0), [pathname]); + return null; +} + function ApolloProviderWithAuth0({ children }) { const auth0 = useAuth0(); const auth0Ref = React.useRef(auth0);