react-frame-component
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -107,3 +107,2 @@ 'use strict'; | ||
var win = doc.defaultView || doc.parentView; | ||
var initialRender = !this._setInitialContent; | ||
var contents = _react2.default.createElement( | ||
@@ -126,7 +125,6 @@ _Content2.default, | ||
if (initialRender) { | ||
if (doc.body.children.length < 1) { | ||
doc.open('text/html', 'replace'); | ||
doc.write(this.props.initialContent); | ||
doc.close(); | ||
this._setInitialContent = true; | ||
} | ||
@@ -133,0 +131,0 @@ |
{ | ||
"name": "react-frame-component", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -89,3 +89,2 @@ import React, { Component } from 'react'; | ||
const win = doc.defaultView || doc.parentView; | ||
const initialRender = !this._setInitialContent; | ||
const contents = ( | ||
@@ -102,7 +101,6 @@ <Content | ||
if (initialRender) { | ||
if (doc.body.children.length < 1) { | ||
doc.open('text/html', 'replace'); | ||
doc.write(this.props.initialContent); | ||
doc.close(); | ||
this._setInitialContent = true; | ||
} | ||
@@ -109,0 +107,0 @@ |
@@ -358,2 +358,13 @@ import React from 'react'; | ||
}); | ||
it('should not error when root component is re-appended', () => { | ||
div = document.body.appendChild(document.createElement('div')); | ||
ReactDOM.render(<Frame />, div); | ||
document.body.append(div); | ||
ReactDOM.render(<Frame />, div); | ||
const iframes = ReactDOM.findDOMNode(div).querySelectorAll('iframe'); | ||
expect(iframes[0].contentDocument.body.children.length).to.equal(1); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24715
44380500