Skip to content

Commit 20e6246

Browse files
committed
fix(ssr): change the way window object was defensively checked.
1 parent daf18f3 commit 20e6246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/VirtualList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const VirtualList = (options, mapVirtualToProps = defaultMapToVirtualProps) => (
4242
this.refreshState = this.refreshState.bind(this);
4343

4444
// if requestAnimationFrame is available, use it to throttle refreshState
45-
if (window && 'requestAnimationFrame' in window) {
45+
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
4646
this.refreshState = throttleWithRAF(this.refreshState);
4747
}
4848
};

0 commit comments

Comments
 (0)