react-animationjs
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -119,8 +119,15 @@ 'use strict'; | ||
}, { | ||
key: 'render', | ||
key: 'checkIfStyledComponent', | ||
value: function checkIfStyledComponent(child) { | ||
if (typeof child.type === 'function') { | ||
return child.type.displayName === 'styled(Component)'; | ||
} | ||
} | ||
/** | ||
* Render children, and their diffs until promise of anime finishes. | ||
*/ | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
@@ -137,3 +144,10 @@ var _this2 = this; | ||
cur.filter(filterNullEls).map(function (child, i) { | ||
return _react2.default.cloneElement(child, { key: i, ref: _this2.addTarget, innerRef: _this2.addTarget }); | ||
var props = { | ||
key: i, | ||
ref: _this2.addTarget | ||
}; | ||
if (_this2.checkIfStyledComponent(child)) { | ||
props.innerRef = _this2.addTarget; | ||
} | ||
return _react2.default.cloneElement(child, props); | ||
}) | ||
@@ -140,0 +154,0 @@ ); |
{ | ||
"name": "react-animationjs", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "An animation library that applies anime.js to it's react children", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -99,2 +99,8 @@ import React, { Component } from 'react'; | ||
checkIfStyledComponent(child) { | ||
if ( typeof child.type === 'function' ) { | ||
return child.type.displayName === 'styled(Component)'; | ||
} | ||
} | ||
/** | ||
@@ -112,5 +118,12 @@ * Render children, and their diffs until promise of anime finishes. | ||
.filter(filterNullEls) | ||
.map((child, i) => | ||
React.cloneElement(child, { key: i, ref: this.addTarget, innerRef: this.addTarget }) | ||
) | ||
.map((child, i) =>{ | ||
let props = { | ||
key: i, | ||
ref: this.addTarget | ||
}; | ||
if (this.checkIfStyledComponent(child)) { | ||
props.innerRef = this.addTarget; | ||
} | ||
return React.cloneElement(child, props); | ||
}) | ||
} | ||
@@ -117,0 +130,0 @@ </g> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86833
2408