I’m learning Next.js for web development and I came across commerce, a boilerplate for e-commerce websites written in Next.js. As I was browsing through the code I found the Sidebar
component which uses React Aria for creating overlays.
I wanted to use this part in my own project, so wrote a Overlay
component that also uses the OverlayContainer
component.
import { useRef } from 'react';
import {
useOverlay,
useModal,
OverlayContainer
} from '@react-aria/overlays';
const Overlay = ({ className, children, open = false, onClose }) => {
const ref = useRef(null);
const { modalProps } = useModal();
let { overlayProps } = useOverlay({ onClose: onClose, open: open, isDismissable: true }, ref);
return (
<OverlayContainer>
<div
{...overlayProps}
{...modalProps}
ref={ref}
>
{children}
</div>
</OverlayContainer>
);
};
export default Overlay;
This component gets loaded in my Layout component, just as in the commerce project.
However, when I try to load up the index page, it gives me the following error:
Server Error ReferenceError: document is not defined This error happened while generating the page. Any console logs will be displayed in the terminal window. Source pages/_document.tsx (90:33) @ Function.getInitialProps 88 | } 89 | > 90 | const { html, head } = await ctx.renderPage({ enhanceApp }) | ^ 91 | const styles = [...flush()] 92 | return { html, head, styles } 93 | }
When I remove the OverlayContainer
component, it loads all fine. I tried updating my dependencies, comparing more code to the Github repo, but nothing found so far.
What’s the problem here? And how could I fix it? I’m using Next 10 with React 17.0.1.
modafinil online – modafinil reviews modafinil reviews
accutane pills for sale – cheap accutane for sale generic accutane
buy tadalafil 20mg uk – uk pharmacy no prescription canadian pharmacy 24h com
ivermectin goodrx – buy ivermectin online ivermectin humans
accutane 40 mg – how to get accutane 80 mg accutane daily
lyrica capsules price – lyrica 75 mg medicine canadian pharmacy ltd.
personal ads free
find someone’s dating profiles free
levitra viagra – sildenafil 100 mexico buy viagra online usa
ivermectin 6mg – ivermectin lotion for lice ivermectin 6mg
buy provigil – provigil 200mg buy modafinil online
buy furosemide 20 mg online – furosemide brand lasix online purchase
genuine viagra online uk – viagra paypal online best online viagra site
wholesale cialis – generic cialis 5mg australia cost of prescription cialis
best place to buy online viagra viagra 50mg online ViagraCND100Mg – sildenafil viagra perth
ivermectin buy online – ivermectin 4000 mcg buy ivermectin cream for humans
pnp gay dating site
sexy gay anime dating sim
dating chinese gay men
casino games – online casino games real money golden nugget online casino
ed pills cheap – ed pills walmart what is the latest treatment for erectile dysfunction
gay dating nh
gay dating websites london
gay korean dating
prednisone generic brand name – prednisone pill prednisone nz
online purchase viagra – sildenafil tabs 50mg drug prices sildenafil
gay dating scene nashville
kenyan gay dating site
gay international dating sites
cialis paypal uk – Cialis mail order tadalafil price in india
ivermectin usa price – ivermectin medicine cost for ivermectin 3mg