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 19cf7f8 commit 275efc4Copy full SHA for 275efc4
src/QueueAnim.jsx
@@ -1,6 +1,21 @@
1
import React, { createElement, cloneElement } from 'react';
2
import { findDOMNode } from 'react-dom';
3
-import velocity from 'velocity-animate';
+
4
+let velocity
5
+if (typeof document !== 'undefined' && typeof window !== 'undefined') {
6
+ // only load velocity on the client
7
+ velocity = require('velocity-animate')
8
9
+} else {
10
+ // provide a velocity stub for the server
11
+ _velocityAnimate = function velocityServerDummy () {
12
+ var callback = arguments[arguments.length - 1]
13
+ // call after stack flushes
14
+ // in case you app depends on the asyncron nature of this function
15
+ setImmediate(function () { callback() })
16
+ }
17
+}
18
19
import {
20
toArrayChildren,
21
findChildInChildrenByKey,
0 commit comments