Skip to content

Commit

Permalink
fix: forcing rerender when route changes #910
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceRodrigues committed Oct 27, 2023
1 parent b9a9c5c commit 394bc4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions explorer/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { config } from "app/config/config";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { useEffect } from "react";
import TagManager from "react-gtm-module";

Expand All @@ -27,6 +28,7 @@ const SESSION_TIMEOUT = 15 * 60 * 1000; // 15 minutes
function MyApp({ Component, pageProps }: AppProps): JSX.Element {
// Set up the site configuration, layout and theme.
const appConfig = config();
const { asPath } = useRouter();
const { analytics, layout, redirectRootToPath, themeOptions } = appConfig;
const { gtmAuth, gtmId, gtmPreview } = analytics || {};
const theme = createAppTheme(themeOptions);
Expand All @@ -52,6 +54,7 @@ function MyApp({ Component, pageProps }: AppProps): JSX.Element {
<FileManifestStateProvider>
<Main>
<ErrorBoundary
key={asPath}
fallbackRender={(
error: DataExplorerError
): JSX.Element => (
Expand Down

0 comments on commit 394bc4e

Please sign in to comment.