From ad83fac66d60d06bc5b37c9b9a763e22f9a7600d Mon Sep 17 00:00:00 2001 From: Nik Tverd <61203447+niktverd@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:29:34 +0600 Subject: [PATCH] fix: document is optional for SSR (#772) --- src/components/BalancedMasonry/BalancedMasonry.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BalancedMasonry/BalancedMasonry.tsx b/src/components/BalancedMasonry/BalancedMasonry.tsx index 4f3ec2e29..0ee9f75ad 100644 --- a/src/components/BalancedMasonry/BalancedMasonry.tsx +++ b/src/components/BalancedMasonry/BalancedMasonry.tsx @@ -42,7 +42,7 @@ const BalancedMasonry = (props: WithChildren) => { for (const [rawWidth, columnCount] of breakpoints) { const width = Number(rawWidth); - if (document.body.clientWidth <= width) { + if (document?.body.clientWidth <= width) { result = columnCount; } }