Matchu
eb8a0cf2a9
The first page moved over! Note that this broke navigation on the rest of the app, so don't deploy this until we're done! The reason it broke was that we had to migrate GlobalHeader and GlobalFooter to the Next.js link & router stuff too, or else it crashed because it wasn't in a react-router-dom context.
24 lines
838 B
TypeScript
24 lines
838 B
TypeScript
import React from "react";
|
|
import type { NextPageWithLayout } from "./_app";
|
|
// import App from '../src'
|
|
|
|
// next/dynamic is used to prevent breaking incompatibilities
|
|
// with SSR from window.SOME_VAR usage, if this is not used
|
|
// next/dynamic can be removed to take advantage of SSR/prerendering
|
|
import dynamic from "next/dynamic";
|
|
|
|
// try changing "ssr" to true below to test for incompatibilities, if
|
|
// no errors occur the above static import can be used instead and the
|
|
// below removed
|
|
const App = dynamic(() => import("../src/app/App"), { ssr: false });
|
|
|
|
const FallbackPage: NextPageWithLayout = () => {
|
|
return <App />;
|
|
};
|
|
|
|
// This old fallback page uses App, which already has PageLayout built-in.
|
|
FallbackPage.layoutComponent = ({ children }: { children: JSX.Element }) => {
|
|
return children;
|
|
};
|
|
|
|
export default FallbackPage;
|