[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!
11 Replies
Deno is on the server-side, not on the client-side
you're trying to render the react component into the DOM in Deno, where there's no DOM
ReactDOMServer
is doing the work
rendering it to a string
I have no clue about notion – is it supposed to be able to work with server-side rendering?
this is
react-notion-x
, which gets data from notion and then just parses itGitHub
GitHub - NotionX/react-notion-x: Fast and accurate React renderer f...
Fast and accurate React renderer for Notion. TS batteries included. ⚡️ - GitHub - NotionX/react-notion-x: Fast and accurate React renderer for Notion. TS batteries included. ⚡️
so theoretically there should be nothing wrong, but for some reason whenever i add the
Collection
component, it just dies lolGitHub
react-notion-x/collection.tsx at master · NotionX/react-notion-x
Fast and accurate React renderer for Notion. TS batteries included. ⚡️ - react-notion-x/collection.tsx at master · NotionX/react-notion-x
Looking at
react-notion-x
, it seems to me like it's actually doing rendering.
Fast and accurate React renderer for Notion.
it is, but it has no problem with the flow i have now
until i add the Collection component
even in a fresh island it's still doing it
so idk
i am trying to use react leaflet in deno + react but it says document not defined
Try adding the following to the top of that file:
This is how Fresh handles it, and how I write all client code in TS and then auto-esbuild it to a JS bundle.