react-transition-group
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -90,3 +90,3 @@ 'use strict'; | ||
CSSTransitionGroup.propTypes = propTypes; | ||
CSSTransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {}; | ||
CSSTransitionGroup.defaultProps = defaultProps; | ||
@@ -93,0 +93,0 @@ |
@@ -226,5 +226,5 @@ 'use strict'; | ||
CSSTransitionGroupChild.propTypes = propTypes; | ||
CSSTransitionGroupChild.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {}; | ||
exports.default = CSSTransitionGroupChild; | ||
module.exports = exports['default']; |
{ | ||
"name": "react-transition-group", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "A react component toolset for managing animations", | ||
@@ -39,5 +39,11 @@ "main": "index.js", | ||
"dom-helpers": "^3.2.0", | ||
"loose-envify": "^1.3.1", | ||
"prop-types": "^15.5.6", | ||
"warning": "^3.0.0" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"loose-envify" | ||
] | ||
} | ||
} |
@@ -54,17 +54,14 @@ 'use strict'; | ||
_this.performAppear = function (key) { | ||
_this.performAppear = function (key, component) { | ||
_this.currentlyTransitioningKeys[key] = true; | ||
var component = _this.childRefs[key]; | ||
if (component.componentWillAppear) { | ||
component.componentWillAppear(_this._handleDoneAppearing.bind(_this, key)); | ||
component.componentWillAppear(_this._handleDoneAppearing.bind(_this, key, component)); | ||
} else { | ||
_this._handleDoneAppearing(key); | ||
_this._handleDoneAppearing(key, component); | ||
} | ||
}; | ||
_this._handleDoneAppearing = function (key) { | ||
var component = _this.childRefs[key]; | ||
if (component && component.componentDidAppear) { | ||
_this._handleDoneAppearing = function (key, component) { | ||
if (component.componentDidAppear) { | ||
component.componentDidAppear(); | ||
@@ -79,21 +76,18 @@ } | ||
// This was removed before it had fully appeared. Remove it. | ||
_this.performLeave(key); | ||
_this.performLeave(key, component); | ||
} | ||
}; | ||
_this.performEnter = function (key) { | ||
_this.performEnter = function (key, component) { | ||
_this.currentlyTransitioningKeys[key] = true; | ||
var component = _this.childRefs[key]; | ||
if (component.componentWillEnter) { | ||
component.componentWillEnter(_this._handleDoneEntering.bind(_this, key)); | ||
component.componentWillEnter(_this._handleDoneEntering.bind(_this, key, component)); | ||
} else { | ||
_this._handleDoneEntering(key); | ||
_this._handleDoneEntering(key, component); | ||
} | ||
}; | ||
_this._handleDoneEntering = function (key) { | ||
var component = _this.childRefs[key]; | ||
if (component && component.componentDidEnter) { | ||
_this._handleDoneEntering = function (key, component) { | ||
if (component.componentDidEnter) { | ||
component.componentDidEnter(); | ||
@@ -108,12 +102,11 @@ } | ||
// This was removed before it had fully entered. Remove it. | ||
_this.performLeave(key); | ||
_this.performLeave(key, component); | ||
} | ||
}; | ||
_this.performLeave = function (key) { | ||
_this.performLeave = function (key, component) { | ||
_this.currentlyTransitioningKeys[key] = true; | ||
var component = _this.childRefs[key]; | ||
if (component.componentWillLeave) { | ||
component.componentWillLeave(_this._handleDoneLeaving.bind(_this, key)); | ||
component.componentWillLeave(_this._handleDoneLeaving.bind(_this, key, component)); | ||
} else { | ||
@@ -123,10 +116,8 @@ // Note that this is somewhat dangerous b/c it calls setState() | ||
// is done. | ||
_this._handleDoneLeaving(key); | ||
_this._handleDoneLeaving(key, component); | ||
} | ||
}; | ||
_this._handleDoneLeaving = function (key) { | ||
var component = _this.childRefs[key]; | ||
if (component && component.componentDidLeave) { | ||
_this._handleDoneLeaving = function (key, component) { | ||
if (component.componentDidLeave) { | ||
component.componentDidLeave(); | ||
@@ -141,3 +132,3 @@ } | ||
// This entered again before it fully left. Add it again. | ||
_this.performEnter(key); | ||
_this.keysToEnter.push(key); | ||
} else { | ||
@@ -170,3 +161,3 @@ _this.setState(function (state) { | ||
if (initialChildMapping[key]) { | ||
this.performAppear(key); | ||
this.performAppear(key, this.childRefs[key]); | ||
} | ||
@@ -202,13 +193,19 @@ } | ||
TransitionGroup.prototype.componentDidUpdate = function componentDidUpdate() { | ||
var _this2 = this; | ||
var keysToEnter = this.keysToEnter; | ||
this.keysToEnter = []; | ||
keysToEnter.forEach(this.performEnter); | ||
keysToEnter.forEach(function (key) { | ||
return _this2.performEnter(key, _this2.childRefs[key]); | ||
}); | ||
var keysToLeave = this.keysToLeave; | ||
this.keysToLeave = []; | ||
keysToLeave.forEach(this.performLeave); | ||
keysToLeave.forEach(function (key) { | ||
return _this2.performLeave(key, _this2.childRefs[key]); | ||
}); | ||
}; | ||
TransitionGroup.prototype.render = function render() { | ||
var _this2 = this; | ||
var _this3 = this; | ||
@@ -220,8 +217,8 @@ // TODO: we could get rid of the need for the wrapper node | ||
var _loop = function _loop(key) { | ||
var child = _this2.state.children[key]; | ||
var child = _this3.state.children[key]; | ||
if (child) { | ||
var isCallbackRef = typeof child.ref !== 'string'; | ||
var factoryChild = _this2.props.childFactory(child); | ||
var factoryChild = _this3.props.childFactory(child); | ||
var ref = function ref(r) { | ||
_this2.childRefs[key] = r; | ||
_this3.childRefs[key] = r; | ||
}; | ||
@@ -276,3 +273,3 @@ | ||
TransitionGroup.propTypes = propTypes; | ||
TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {}; | ||
TransitionGroup.defaultProps = defaultProps; | ||
@@ -279,0 +276,0 @@ |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
120482
9
2407
7
27
1
+ Addedloose-envify@^1.3.1