Skip to content

Commit

Permalink
Changed Editor component to be dynamic (#126)
Browse files Browse the repository at this point in the history
New PR because last was hanging - lets try again
---
This PR just changes the Editor component to be dynamic, so we can set
server side rendering to false. This _should_ fix the prod frontend
build errors _(hopefully)_

Tested locally on docker
  • Loading branch information
ostepizza authored Apr 24, 2024
1 parent 36f62b5 commit 3deb80d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions frontend/app/Editor/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use client';
import Editor from '../../components/component/editor';
import { useRouter } from 'next/navigation';
import dynamic from 'next/dynamic';

const DynamicEditor = dynamic(
() => import('../../components/component/editor'),
{ ssr: false }
);

// This comment is added here because GitHub is hanging at "Checking for ability to merge automatically…"
export default function Page() {
const router = useRouter();
// check window object to see if we are in the browser or not then redirect to the home page
if (typeof window == 'undefined') {
router.push('/');
}
return (
<main>
{typeof window !== 'undefined' ? <Editor /> : null}
</main>
);
return (
<main>
<DynamicEditor />
</main>
);
}

0 comments on commit 3deb80d

Please sign in to comment.