mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Only add children when there are children
This commit is contained in:
@@ -85,7 +85,10 @@ var ReactDOMOption = {
|
||||
}
|
||||
});
|
||||
|
||||
nativeProps.children = content;
|
||||
if (content) {
|
||||
nativeProps.children = content;
|
||||
}
|
||||
|
||||
return nativeProps;
|
||||
},
|
||||
|
||||
|
||||
@@ -63,4 +63,12 @@ describe('ReactDOMOption', function() {
|
||||
expect(console.error.calls.length).toBe(0);
|
||||
expect(node.innerHTML).toBe('1 2');
|
||||
});
|
||||
|
||||
it('should be able to use dangerouslySetInnerHTML on option', function() {
|
||||
var stub = <option dangerouslySetInnerHTML={{ __html: 'foobar' }} />;
|
||||
stub = ReactTestUtils.renderIntoDocument(stub);
|
||||
|
||||
var node = ReactDOM.findDOMNode(stub);
|
||||
expect(node.innerHTML).toBe('foobar');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user