Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-animate

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-animate - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

27

lib/Animate.js

@@ -23,2 +23,16 @@ 'use strict';

var defaultKey = 'rc_animate_' + Date.now();
function getChildrenFromProps(props) {
var children = props.children;
if (_react2['default'].isValidElement(children)) {
if (!children.key) {
return _react2['default'].cloneElement(children, {
key: defaultKey
});
}
}
return children;
}
var Animate = _react2['default'].createClass({

@@ -55,3 +69,3 @@ displayName: 'Animate',

return {
children: (0, _ChildrenUtils.toArrayChildren)(this.props.children)
children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props))
};

@@ -63,3 +77,3 @@ },

var nextChildren = (0, _ChildrenUtils.toArrayChildren)(nextProps.children);
var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
var props = this.props;

@@ -70,3 +84,3 @@ var showProp = props.showProp;

// exclusive needs immediate response
var currentChildren = exclusive ? (0, _ChildrenUtils.toArrayChildren)(props.children) : this.state.children;
var currentChildren = exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
var newChildren = _ChildrenUtils2['default'].mergeChildren(currentChildren, nextChildren);

@@ -144,3 +158,3 @@

delete this.currentlyAnimatingKeys[key];
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(this.props.children);
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props));
if (!this.isValidChildByKey(currentChildren, key)) {

@@ -175,3 +189,3 @@ // exclusive will not need this

delete this.currentlyAnimatingKeys[key];
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(this.props.children);
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props));
// in case state change is too fast

@@ -218,2 +232,5 @@ if (this.isValidChildByKey(currentChildren, key)) {

var children = this.state.children.map(function (child) {
if (!child.key) {
throw new Error('must set key for <rc-animate> children');
}
return _react2['default'].createElement(

@@ -220,0 +237,0 @@ _AnimateChild2['default'],

2

package.json
{
"name": "rc-animate",
"version": "1.0.0",
"version": "1.0.1",
"description": "css-transition ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

@@ -26,6 +26,2 @@ # rc-animate

## Screenshots
![](http://gtms02.alicdn.com/tps/i2/TB1l3yrHXXXXXXWXpXXM9PE9pXX-446-343.png)
## Feature

@@ -32,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc