JordanJ
Deno3y ago
Jordan

[react] document is not defined

the following code returns
document is not defined
. i have no idea how i'd go about fixing this. the example uses next.js'
dynamic()
but i'm doing this in "plain" react. any ideas? thanks!
import { NotionAPI } from "https://esm.sh/notion-client@6.15.6";
import { NotionRenderer } from "https://esm.sh/react-notion-x@6.15.7";

import { Collection } from 'https://esm.sh/react-notion-x/build/third-party/collection'

import { React, Suspense, ReactDOMServer, DOMParser } from "../deps.ts";

const notion = new NotionAPI();
const recordMap = await notion.getPage("f675efad218a4aea85546c036957f3f8");

export default function App (){
  return (
      <NotionRenderer recordMap={recordMap} fullPage={true} darkMode={true} components={{Collection}} />
  )
}
Was this page helpful?