Skip to content

Commit 1eff702

Browse files
authored
Merge pull request #353 from eugen1j/fix-ssr
Fix broken ssr
2 parents a6bd91e + 956422e commit 1eff702

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/utils/dom.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ export const removeAttr = (el: HTMLElement, attr: string): void => {
106106
export const isTag = (tag: any, name: any): boolean =>
107107
toString(tag).toLowerCase() === toString(name).toLowerCase()
108108

109-
export const requestAF: AnimationFrame =
110-
window.requestAnimationFrame ||
111-
window.webkitRequestAnimationFrame ||
112-
window.mozRequestAnimationFrame ||
113-
window.msRequestAnimationFrame ||
114-
window.oRequestAnimationFrame ||
115-
// Fallback, but not a true polyfill
116-
// Only needed for Opera Mini
117-
/* istanbul ignore next */
118-
((cb) => setTimeout(cb, 16))
109+
export const requestAF: AnimationFrame = HAS_WINDOW_SUPPORT
110+
? window.requestAnimationFrame ||
111+
window.webkitRequestAnimationFrame ||
112+
window.mozRequestAnimationFrame ||
113+
window.msRequestAnimationFrame ||
114+
window.oRequestAnimationFrame ||
115+
// Fallback, but not a true polyfill
116+
// Only needed for Opera Mini
117+
/* istanbul ignore next */
118+
((cb) => setTimeout(cb, 16))
119+
: (cb) => setTimeout(cb, 0)

0 commit comments

Comments
 (0)