react-d3-cloud
react-d3-cloud copied to clipboard
Document is not defined
Hey I'm using this library in Nextjs, i've tried to use {typeof window !== undefined} but still getting an error that Document is not defined, any suggestions ?
Hi, use this snippet before your main render and return if the env is not browser:
if (typeof window !== 'undefined' || !!process?.browser) return null
if (typeof document === 'undefined' || typeof window === 'undefined' || !!process?.browser) return null
I'm getting same error after adding this to the component it os not rendering anything. any workaround?