Skip to content

Commit

Permalink
fixed notion code block not rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
nimit9 committed Mar 24, 2024
1 parent 8125ae2 commit 6f66461
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/NotionRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { useEffect, useState } from 'react';
import { NotionRenderer as NotionRendererLib } from 'react-notion-x';
// core styles shared by all of react-notion-x (required)
import 'react-notion-x/src/styles.css';
import dynamic from 'next/dynamic';

const Code = dynamic(() =>
import('react-notion-x/build/third-party/code').then((m) => m.Code),
);
const Equation = dynamic(() =>
import('react-notion-x/build/third-party/equation').then((m) => m.Equation),
);

// used for code syntax highlighting (optional)
import 'prismjs/themes/prism-tomorrow.css';
Expand Down Expand Up @@ -36,6 +44,10 @@ export const NotionRenderer = ({ id }: { id: string }) => {
fullPage={true}
darkMode={true}
className="z-10"
components={{
Code,
Equation,
}}
/>
</div>
</div>
Expand Down

0 comments on commit 6f66461

Please sign in to comment.