From 02818d3f1778ff373cca1fdd459375d3cb57f28b Mon Sep 17 00:00:00 2001 From: Luis Orbaiceta <44276180+luisorbaiceta@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:15:56 +0200 Subject: [PATCH] fix: dynamically import Modal component fixes error "document is not defined" if the user decides to display a modal at the beginning (for ads, promotions, etc...) --- components/common/Layout/Layout.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 2e53bed62..5a75e1fbc 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -42,6 +42,11 @@ const FeatureBar = dynamic( dynamicProps ) +const Modal = dynamic( + () => import('@components/interface/Modal'), + {...dynamicProps, ssr: false} +) + interface Props { pageProps: { pages?: Page[]