Skip to content

Commit 2690b26

Browse files
committed
Disable NextJS Server Side Rendering for explorer:
All contents are loaded clientSide anyway.
1 parent 4a7bb85 commit 2690b26

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mithril-explorer/pages/_app.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'bootstrap/dist/css/bootstrap.min.css';
22
import 'bootstrap-icons/font/bootstrap-icons.css';
33
import '../styles/globals.css'
4+
import dynamic from "next/dynamic";
45
import Script from "next/script";
56
import {Provider} from "react-redux";
67
import {saveToLocalStorage, storeWrapper} from "../store/store";
@@ -22,4 +23,10 @@ function MithrilExplorer({ Component, ...rest }) {
2223
);
2324
}
2425

25-
export default MithrilExplorer;
26+
// Disable Server Side Rendering, this as SEO implication since the site won't be rendered by bots without
27+
// them running client javascript.
28+
// If enabled this leads to NextJs/React hydration errors since the server side rendered page won't
29+
// have access to the saved local storage settings.
30+
export default dynamic(() => Promise.resolve(MithrilExplorer), {
31+
ssr: false
32+
});

0 commit comments

Comments
 (0)