Skip to content

Commit

Permalink
fix: document is optional for SSR (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
niktverd authored Jan 15, 2024
1 parent c114463 commit ad83fac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/BalancedMasonry/BalancedMasonry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const BalancedMasonry = (props: WithChildren<BalancedMasonryProps>) => {
for (const [rawWidth, columnCount] of breakpoints) {
const width = Number(rawWidth);

if (document.body.clientWidth <= width) {
if (document?.body.clientWidth <= width) {
result = columnCount;
}
}
Expand Down

0 comments on commit ad83fac

Please sign in to comment.