Skip to content

Commit fcabab9

Browse files
author
Jannick Garthen
committed
fix(ViewportCollector): server side rendering
1 parent 6176083 commit fcabab9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ViewportCollector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { IDimensions, IScroll, IViewport, OnUpdateType } from './types';
1515

1616
export const getClientDimensions = (): IDimensions => {
17-
if (!document || !document.documentElement) {
17+
if (typeof document === 'undefined' || !document.documentElement) {
1818
return createEmptyDimensionState();
1919
}
2020
const { innerWidth, innerHeight, outerWidth, outerHeight } = window;

0 commit comments

Comments
 (0)