Skip to content

Commit

Permalink
Merge pull request #185 from Betree/fix/184-undefined-window
Browse files Browse the repository at this point in the history
Check for undefined window to support SSR
  • Loading branch information
bvaughn authored Mar 18, 2019
2 parents 53c26b4 + c29625e commit 488db17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/createGridComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const defaultItemKey = ({ columnIndex, data, rowIndex }) =>
let devWarningsOverscanCount = null;
let devWarningsTagName = null;
if (process.env.NODE_ENV !== 'production') {
if (typeof window.WeakSet !== 'undefined') {
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
devWarningsOverscanCount = new WeakSet();
devWarningsTagName = new WeakSet();
}
Expand Down
2 changes: 1 addition & 1 deletion src/createListComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const defaultItemKey = (index: number, data: any) => index;
let devWarningsDirection = null;
let devWarningsTagName = null;
if (process.env.NODE_ENV !== 'production') {
if (typeof window.WeakSet !== 'undefined') {
if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
devWarningsDirection = new WeakSet();
devWarningsTagName = new WeakSet();
}
Expand Down

0 comments on commit 488db17

Please sign in to comment.