We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0d3e88 commit 5813b0cCopy full SHA for 5813b0c
src/utils.js
@@ -13,7 +13,10 @@ const trnasitionEndObject = {
13
MozTransition: 'transitionend',
14
OTransition: 'oTransitionEnd otransitionend',
15
};
16
-const trnasitionStr = Object.keys(trnasitionEndObject).filter(key =>
17
- key in (document && document.body.style)
18
-)[0];
+const trnasitionStr = Object.keys(trnasitionEndObject).filter(key => {
+ if (typeof document === 'undefined') {
+ return false;
19
+ }
20
+ return key in (document.body && document.body.style);
21
+})[0];
22
export const transitionEnd = trnasitionEndObject[trnasitionStr];
0 commit comments