Closed ApplePieGiraffe closed 3 years ago
This is because Next.js do SSR (server-side-rendering). Just wrap your import like this:
import dynamic from 'next/dynamic';
const CustomScroller = dynamic( () => import('react-custom-scroller'), { ssr: false });
Ooh, okay, thank you.
I'm trying to use react-custom-scroller with Next.js, but when I import react-custom-scroller into one of my files and try to render my page, I get the error, "ReferenceError: document is not defined."
Is this because react-custom-scroller is trying to access the document on the server or something?
IDK, but what can I do to fix this?