react-modal-dialog
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -45,2 +45,7 @@ 'use strict'; | ||
_this._component = renderSubtreeIntoContainer(_this, _this.props.children, _this._target); | ||
// A handler call in case you want to do something when a modal opens, like add a class to the body or something | ||
if (typeof _this.props.onModalDidMount === 'function') { | ||
_this.props.onModalDidMount(); | ||
} | ||
}; | ||
@@ -64,2 +69,8 @@ | ||
var done = function done() { | ||
// Modal will unmount now | ||
// Call a handler, like onModalDidMount | ||
if (typeof _this.props.onModalWillUnmount === 'function') { | ||
_this.props.onModalWillUnmount(); | ||
} | ||
// Remove the node and clean up after the target | ||
@@ -92,4 +103,5 @@ _reactDom2['default'].unmountComponentAtNode(_this._target); | ||
onClose: _react.PropTypes.func, // This is called when the dialog should close | ||
children: _react.PropTypes.node | ||
}, | ||
children: _react.PropTypes.node, | ||
onModalDidMount: _react.PropTypes.func, // optional, called on mount | ||
onModalWillUnmount: _react.PropTypes.func }, | ||
enumerable: true | ||
@@ -103,4 +115,5 @@ }]); | ||
module.exports = exports['default']; | ||
// optional, called on unmount | ||
// HTMLElement, a div that is appended to the body | ||
// ReactComponent, which is mounted on the target | ||
// This doesn't actually return anything to render |
{ | ||
"name": "react-modal-dialog", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A simple, idiomatic, and declarative way to launch modal dialogs in ReactJS", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
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
825
54648
12
2
0