Skip to content

Commit

Permalink
vendor/detectElementResize: fix window check for SSR (#945)
Browse files Browse the repository at this point in the history
'this' is undefined at this point, so you will get errors like `Cannot read
property 'requestAnimationFrame' of undefined` when assigning to variable `raf`
on the server.
  • Loading branch information
eqyiel authored and TrySound committed Jan 5, 2018
1 parent 6aacced commit 2a4c52d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/vendor/detectElementResize.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function createDetectElementResize(nonce) {
} else if (typeof self !== 'undefined') {
_window = self;
} else {
_window = this;
_window = global;
}

var attachEvent = typeof document !== 'undefined' && document.attachEvent;
Expand Down

0 comments on commit 2a4c52d

Please sign in to comment.