react-frame-component
Advanced tools
Comparing version 0.3.3 to 0.3.4
var React = require('react'); | ||
var assign = require('object-assign'); | ||
@@ -9,3 +10,4 @@ var Frame = React.createClass({ | ||
render: function() { | ||
return React.createElement('iframe', this.props); | ||
// The iframe isn't ready so we drop children from props here. #12, #17 | ||
return React.createElement('iframe', assign({}, this.props, {children: undefined})); | ||
}, | ||
@@ -12,0 +14,0 @@ componentDidMount: function() { |
{ | ||
"name": "react-frame-component", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes", | ||
@@ -39,3 +39,6 @@ "main": "index.js", | ||
"react": ">=0.13.0" | ||
}, | ||
"dependencies": { | ||
"object-assign": "^3.0.0" | ||
} | ||
} |
@@ -1,3 +0,1 @@ | ||
/** @jsx React.DOM */ | ||
"use strict"; | ||
@@ -27,2 +25,17 @@ | ||
it("should not pass this.props.children in iframe render", function () { | ||
spyOn(React, 'createElement').andCallThrough(); | ||
var frame = ReactTestUtils.renderIntoDocument( | ||
<Frame className='foo'> | ||
<div /> | ||
</Frame> | ||
); | ||
expect(React.createElement).toHaveBeenCalledWith('iframe',{ | ||
children: undefined, | ||
className: 'foo' | ||
}); | ||
expect(frame.props.children).toBeDefined(); | ||
}); | ||
it("should create an empty iFrame and apply inline styles", function () { | ||
@@ -29,0 +42,0 @@ var frame = ReactTestUtils.renderIntoDocument(<Frame style={{border:0}} />); |
645548
17882
2
+ Addedobject-assign@^3.0.0
+ Addedobject-assign@3.0.0(transitive)