react-gateway
Advanced tools
Comparing version 2.3.0 to 2.5.0
@@ -38,3 +38,3 @@ 'use strict'; | ||
Gateway.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) { | ||
this.gatewayRegistry.clearChild(this.props.into); | ||
this.gatewayRegistry.clearChild(this.props.into, this.props.children); | ||
this.renderIntoGatewayNode(props); | ||
@@ -44,3 +44,3 @@ }; | ||
Gateway.prototype.componentWillUnmount = function componentWillUnmount() { | ||
this.gatewayRegistry.removeChild(this.props.into); | ||
this.gatewayRegistry.removeChild(this.props.into, this.props.children); | ||
}; | ||
@@ -47,0 +47,0 @@ |
@@ -50,10 +50,9 @@ 'use strict'; | ||
GatewayDest.prototype.render = function render() { | ||
var _props = this.props; | ||
var component = _props.component; | ||
var tagName = _props.tagName; | ||
var _props = this.props, | ||
component = _props.component, | ||
tagName = _props.tagName, | ||
attrs = _objectWithoutProperties(_props, ['component', 'tagName']); | ||
var attrs = _objectWithoutProperties(_props, ['component', 'tagName']); | ||
delete attrs.name; | ||
return _react2.default.createElement(component || tagName || 'div', attrs, this.state.child); | ||
return _react2.default.createElement(component || tagName || 'div', attrs, this.state.children); | ||
}; | ||
@@ -60,0 +59,0 @@ |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -21,3 +21,3 @@ exports.__esModule = true; | ||
this._containers[name].setState({ | ||
child: this._children[name] | ||
children: this._children[name] | ||
}); | ||
@@ -36,15 +36,15 @@ }; | ||
GatewayRegistry.prototype.addChild = function addChild(name, child) { | ||
if (this._children[name]) { | ||
console.warn('Only a single Gateway can be rendered at a time into a GatewayDest.' + ('You rendered multiple into "' + name + '"')); | ||
} | ||
this._children[name] = child; | ||
this._children[name] = this._children[name] || []; | ||
this._children[name].push(child); | ||
this._renderContainer(name); | ||
}; | ||
GatewayRegistry.prototype.clearChild = function clearChild(name) { | ||
this._children[name] = null; | ||
GatewayRegistry.prototype.clearChild = function clearChild(name, child) { | ||
this._children[name] = this._children[name].filter(function (item) { | ||
return item !== child; | ||
}); | ||
}; | ||
GatewayRegistry.prototype.removeChild = function removeChild(name) { | ||
this.clearChild(name); | ||
GatewayRegistry.prototype.removeChild = function removeChild(name, child) { | ||
this.clearChild(name, child); | ||
this._renderContainer(name); | ||
@@ -51,0 +51,0 @@ }; |
'use strict'; | ||
exports.__esModule = true; | ||
exports.GatewayProvider = exports.GatewayDest = exports.Gateway = undefined; | ||
exports.GatewayRegistry = exports.GatewayProvider = exports.GatewayDest = exports.Gateway = undefined; | ||
@@ -18,2 +18,6 @@ var _Gateway2 = require('./Gateway'); | ||
var _GatewayRegistry2 = require('./GatewayRegistry'); | ||
var _GatewayRegistry3 = _interopRequireDefault(_GatewayRegistry2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -23,2 +27,3 @@ | ||
exports.GatewayDest = _GatewayDest3.default; | ||
exports.GatewayProvider = _GatewayProvider3.default; | ||
exports.GatewayProvider = _GatewayProvider3.default; | ||
exports.GatewayRegistry = _GatewayRegistry3.default; |
{ | ||
"name": "react-gateway", | ||
"version": "2.3.0", | ||
"version": "2.5.0", | ||
"description": "Render React DOM into a new context", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -42,3 +42,3 @@ # React Gateway | ||
</div> | ||
<GatewayDest name="one" tagName="section" className="hello"/> | ||
<GatewayDest name="one" component="section" className="hello"/> | ||
<GatewayDest name="two"/> | ||
@@ -45,0 +45,0 @@ </div> |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
18308
182
1