Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit 23b53cb

Browse files
committed
Merge pull request #39 from arush/patch-1
use the existing instance of Velocity instead of requiring a new one
2 parents dfe4f11 + 83793ba commit 23b53cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/velocity-animate-shim.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
// that they'll render, rather than doing something clever like
44
// statically rendering the end state of any provided animations.
55
if (typeof window !== 'undefined') {
6-
module.exports = require('velocity-animate');
6+
7+
// this is how velocity-ui finds the Velocity instance, so lets make sure we find the right instance
8+
var g = (window.jQuery || window.Zepto || window);
9+
10+
// require Velocity if it doesn't already exist
11+
module.exports = g.Velocity ? g.Velocity : require('velocity-animate');
12+
713
} else {
814
var Velocity = function () {};
915
Velocity.velocityReactServerShim = true;

0 commit comments

Comments
 (0)