react-redux-toastr
Advanced tools
Comparing version 3.1.4 to 3.2.0
@@ -0,1 +1,4 @@ | ||
#3.1.4 | ||
Add the font-icons to the lib folder. | ||
#3.0.0 | ||
@@ -2,0 +5,0 @@ Remove `dangerouslysetinnerhtml` and implment `component` `option`. |
@@ -69,3 +69,3 @@ 'use strict'; | ||
this._setTransition(); | ||
(0, _utils.onCSSTransitionEnd)(this.toastrBox, this._onAnimationComplite); | ||
(0, _utils.onCSSTransitionEnd)(this.toastrBox, this._onAnimationComplete); | ||
}; | ||
@@ -124,3 +124,3 @@ | ||
{ className: 'message' }, | ||
_react2.default.createElement(this.props.item.options.component, null) | ||
this._renderSubComponent(this.props.item.options.component) | ||
) | ||
@@ -142,3 +142,3 @@ ) | ||
this._onAnimationComplite = function () { | ||
this._onAnimationComplete = function () { | ||
var _props = _this3.props; | ||
@@ -166,3 +166,3 @@ var remove = _props.remove; | ||
_this3._setTransition(true); | ||
(0, _utils.onCSSTransitionEnd)(_this3.toastrBox, _this3._onAnimationComplite); | ||
(0, _utils.onCSSTransitionEnd)(_this3.toastrBox, _this3._onAnimationComplete); | ||
} | ||
@@ -198,4 +198,12 @@ }; | ||
}; | ||
this._renderSubComponent = function (SubComponent) { | ||
// If SubComponent is already a valid React element, just render it. | ||
if ((0, _react.isValidElement)(SubComponent)) return SubComponent; | ||
// If SubComponent is a class reference, create a React element from it | ||
return _react2.default.createElement(SubComponent, null); | ||
}; | ||
}; | ||
exports.default = ToastrBox; |
{ | ||
"name": "react-redux-toastr", | ||
"version": "3.1.4", | ||
"version": "3.2.0", | ||
"description": "react-redux-toastr is a React toastr message implemented with Redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
import CSSCore from 'fbjs/lib/CSSCore'; | ||
import React, {Component, PropTypes, dangerouslySetInnerHTML} from 'react'; // eslint-disable-line no-unused-vars | ||
import React, {Component, PropTypes, isValidElement} from 'react'; // eslint-disable-line no-unused-vars | ||
import cn from 'classnames'; | ||
@@ -36,3 +36,3 @@ | ||
this._setTransition(); | ||
onCSSTransitionEnd(this.toastrBox, this._onAnimationComplite); | ||
onCSSTransitionEnd(this.toastrBox, this._onAnimationComplete); | ||
} | ||
@@ -62,3 +62,3 @@ | ||
_onAnimationComplite = () => { | ||
_onAnimationComplete = () => { | ||
const {remove, item} = this.props; | ||
@@ -82,3 +82,3 @@ const {options, id} = item; | ||
this._setTransition(true); | ||
onCSSTransitionEnd(this.toastrBox, this._onAnimationComplite); | ||
onCSSTransitionEnd(this.toastrBox, this._onAnimationComplete); | ||
} | ||
@@ -115,2 +115,12 @@ }; | ||
_renderSubComponent = (SubComponent) => { | ||
// If SubComponent is already a valid React element, just render it. | ||
if (isValidElement(SubComponent)) return SubComponent; | ||
// If SubComponent is a class reference, create a React element from it | ||
return ( | ||
<SubComponent /> | ||
); | ||
}; | ||
render() { | ||
@@ -129,3 +139,3 @@ return ( | ||
<div className="message"> | ||
<this.props.item.options.component /> | ||
{this._renderSubComponent(this.props.item.options.component)} | ||
</div> | ||
@@ -132,0 +142,0 @@ } |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
0
179
71584
33
1274