react-portal
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -207,3 +207,10 @@ 'use strict'; | ||
} | ||
this.portal = _reactDom2.default.unstable_renderSubtreeIntoContainer(this, _react2.default.cloneElement(props.children, { closePortal: this.closePortal }), this.node, this.props.onUpdate); | ||
var children = props.children; | ||
// https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
if (typeof props.children.type === 'function') { | ||
children = _react2.default.cloneElement(props.children, { closePortal: this.closePortal }); | ||
} | ||
this.portal = _reactDom2.default.unstable_renderSubtreeIntoContainer(this, children, this.node, this.props.onUpdate); | ||
} | ||
@@ -210,0 +217,0 @@ }, { |
@@ -153,5 +153,12 @@ import React from 'react'; | ||
} | ||
let children = props.children; | ||
// https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
if (typeof props.children.type === 'function') { | ||
children = React.cloneElement(props.children, { closePortal: this.closePortal }); | ||
} | ||
this.portal = ReactDOM.unstable_renderSubtreeIntoContainer( | ||
this, | ||
React.cloneElement(props.children, { closePortal: this.closePortal }), | ||
children, | ||
this.node, | ||
@@ -158,0 +165,0 @@ this.props.onUpdate |
{ | ||
"name": "react-portal", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "React component for transportation of modals, lightboxes, loading bars... to document.body", | ||
@@ -61,5 +61,5 @@ "main": "build/portal", | ||
"mocha-eslint": "^2.0.2", | ||
"react": "^15.1.0", | ||
"react-addons-test-utils": "^15.1.0", | ||
"react-dom": "^15.1.0", | ||
"react": "^15.2.0", | ||
"react-addons-test-utils": "^15.2.0", | ||
"react-dom": "^15.2.0", | ||
"rimraf": "^2.5.0", | ||
@@ -66,0 +66,0 @@ "sinon": "^1.17.4", |
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
1851237
1009