Skip to content

Commit

Permalink
fix(use-breakpoint): window access for ssr error fix (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
oowldev authored Jan 23, 2022
1 parent 201b0b7 commit 888ecc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/use-breakpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.createUseBreakpoint =
theme: useTheme(),
});
const mq = useMemo(
() => window.matchMedia(mediaQuery.replace(/^@media\s*/, '')),
() => typeof window === 'undefined' ? false : window.matchMedia(mediaQuery.replace(/^@media\s*/, '')),
[mediaQuery]
);

Expand Down

0 comments on commit 888ecc2

Please sign in to comment.