mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
@@ -93,7 +93,7 @@ assign(ReactDOMTextComponent.prototype, {
|
||||
if (parentInfo) {
|
||||
// parentInfo should always be present except for the top-level
|
||||
// component when server rendering
|
||||
validateDOMNesting(this._tag, this, parentInfo);
|
||||
validateDOMNesting('span', this, parentInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -926,17 +926,21 @@ describe('ReactDOMComponent', function() {
|
||||
});
|
||||
var Foo = React.createClass({
|
||||
render: function() {
|
||||
return <table><Row /></table>;
|
||||
return <table><Row /> </table>;
|
||||
},
|
||||
});
|
||||
ReactTestUtils.renderIntoDocument(<Foo />);
|
||||
|
||||
expect(console.error.calls.length).toBe(1);
|
||||
expect(console.error.calls.length).toBe(2);
|
||||
expect(console.error.argsForCall[0][0]).toBe(
|
||||
'Warning: validateDOMNesting(...): <tr> cannot appear as a child of ' +
|
||||
'<table>. See Foo > table > Row > tr. Add a <tbody> to your code to ' +
|
||||
'match the DOM tree generated by the browser.'
|
||||
);
|
||||
expect(console.error.argsForCall[1][0]).toBe(
|
||||
'Warning: validateDOMNesting(...): <span> cannot appear as a child ' +
|
||||
'of <table>. See Foo > table > span.'
|
||||
);
|
||||
});
|
||||
|
||||
it('gives useful context in warnings', () => {
|
||||
|
||||
Reference in New Issue
Block a user