react-frame-component
Advanced tools
Comparing version 4.1.3 to 5.0.0-alpha.0
@@ -49,7 +49,12 @@ 'use strict'; | ||
_this.setRef = function (node) { | ||
_this.node = node; | ||
}; | ||
_this.handleLoad = function () { | ||
_this.forceUpdate(); | ||
_this.setState({ iframeLoaded: true }); | ||
}; | ||
_this._isMounted = false; | ||
_this.state = { iframeLoaded: false }; | ||
return _this; | ||
@@ -125,8 +130,2 @@ } | ||
if (doc.body.children.length < 1) { | ||
doc.open('text/html', 'replace'); | ||
doc.write(this.props.initialContent); | ||
doc.close(); | ||
} | ||
var mountTarget = this.getMountTarget(); | ||
@@ -139,5 +138,4 @@ | ||
value: function render() { | ||
var _this2 = this; | ||
var props = _extends({}, this.props, { | ||
srcDoc: this.props.initialContent, | ||
children: undefined // The iframe isn't ready so we drop children from props here. #12, #17 | ||
@@ -152,8 +150,4 @@ }); | ||
'iframe', | ||
_extends({}, props, { | ||
ref: function ref(node) { | ||
_this2.node = node; | ||
} | ||
}), | ||
this.renderFrameContents() | ||
_extends({}, props, { ref: this.setRef, onLoad: this.handleLoad }), | ||
this.state.iframeLoaded && this.renderFrameContents() | ||
); | ||
@@ -160,0 +154,0 @@ } |
{ | ||
"name": "react-frame-component", | ||
"version": "4.1.3", | ||
"version": "5.0.0-alpha.0", | ||
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes", | ||
@@ -25,2 +25,5 @@ "main": "lib/index.js", | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"repository": { | ||
@@ -79,4 +82,4 @@ "type": "git", | ||
"prop-types": "^15.5.9", | ||
"react": "^16.6.0", | ||
"react-dom": "^16.6.0", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"rimraf": "^2.5.4", | ||
@@ -83,0 +86,0 @@ "sinon": "2.0.0-pre", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
18578
0
227
1