react-frame-component 5.2.5 → 5.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@ declare module 'react-frame-component' {
16
16
  export default FrameComponent;
17
17
 
18
18
  export interface FrameContextProps {
19
- document?: HTMLDocument;
19
+ document?: Document;
20
20
  window?: Window;
21
21
  }
22
22
 
package/lib/Frame.js CHANGED
@@ -67,9 +67,11 @@ var Frame = exports.Frame = function (_Component) {
67
67
  }
68
68
  };
69
69
 
70
- _this.loadCheck = setInterval(function loadCheckCallback() {
71
- this.handleLoad();
72
- }, 500);
70
+ _this.loadCheck = function () {
71
+ return setInterval(function () {
72
+ _this.handleLoad();
73
+ }, 500);
74
+ };
73
75
 
74
76
  _this._isMounted = false;
75
77
  _this.nodeRef = _react2.default.createRef();
@@ -149,6 +151,10 @@ var Frame = exports.Frame = function (_Component) {
149
151
 
150
152
  var mountTarget = this.getMountTarget();
151
153
 
154
+ if (!mountTarget) {
155
+ return null;
156
+ }
157
+
152
158
  return [_reactDom2.default.createPortal(this.props.head, this.getDoc().head), _reactDom2.default.createPortal(contents, mountTarget)];
153
159
  }
154
160
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frame-component",
3
- "version": "5.2.5",
3
+ "version": "5.2.7",
4
4
  "description": "React component to wrap your application or component in an iFrame for encapsulation purposes",
5
5
  "main": "lib/index.js",
6
6
  "files": [