mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
* addresses issue #7065 * fix test to use new message * fix string in tests * fix test string * Update error message and tests
This commit is contained in:
1 parent
25f9f4563e
commit
f94912516f
2 files changed
+14
-14
No files matched your search
@@ -155,8 +155,8 @@ function assertValidProps(component, props) {
|
||||
if (voidElementTags[component._tag]) {
|
||||
invariant(
|
||||
props.children == null && props.dangerouslySetInnerHTML == null,
|
||||
'%s is a void element tag and must not have `children` or ' +
|
||||
'use `props.dangerouslySetInnerHTML`.%s',
|
||||
'%s is a void element tag and must neither have `children` nor ' +
|
||||
'use `dangerouslySetInnerHTML`.%s',
|
||||
component._tag,
|
||||
component._currentElement._owner ?
|
||||
' Check the render method of ' +
|
||||
|
||||
@@ -759,8 +759,8 @@ describe('ReactDOMComponent', function() {
|
||||
expect(function() {
|
||||
ReactDOM.render(<input>children</input>, container);
|
||||
}).toThrowError(
|
||||
'input is a void element tag and must not have `children` or ' +
|
||||
'use `props.dangerouslySetInnerHTML`.'
|
||||
'input is a void element tag and must neither have `children` nor ' +
|
||||
'use `dangerouslySetInnerHTML`.'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -773,8 +773,8 @@ describe('ReactDOMComponent', function() {
|
||||
container
|
||||
);
|
||||
}).toThrowError(
|
||||
'input is a void element tag and must not have `children` or use ' +
|
||||
'`props.dangerouslySetInnerHTML`.'
|
||||
'input is a void element tag and must neither have `children` nor use ' +
|
||||
'`dangerouslySetInnerHTML`.'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -788,8 +788,8 @@ describe('ReactDOMComponent', function() {
|
||||
expect(function() {
|
||||
ReactDOM.render(<menu><menuitem>children</menuitem></menu>, container);
|
||||
}).toThrowError(
|
||||
'menuitem is a void element tag and must not have `children` or use ' +
|
||||
'`props.dangerouslySetInnerHTML`.'
|
||||
'menuitem is a void element tag and must neither have `children` nor use ' +
|
||||
'`dangerouslySetInnerHTML`.'
|
||||
);
|
||||
|
||||
});
|
||||
@@ -943,8 +943,8 @@ describe('ReactDOMComponent', function() {
|
||||
expect(function() {
|
||||
ReactDOM.render(<X />, container);
|
||||
}).toThrowError(
|
||||
'input is a void element tag and must not have `children` ' +
|
||||
'or use `props.dangerouslySetInnerHTML`. Check the render method of X.'
|
||||
'input is a void element tag and must neither have `children` ' +
|
||||
'nor use `dangerouslySetInnerHTML`. Check the render method of X.'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -973,8 +973,8 @@ describe('ReactDOMComponent', function() {
|
||||
expect(function() {
|
||||
ReactDOM.render(<input>children</input>, container);
|
||||
}).toThrowError(
|
||||
'input is a void element tag and must not have `children` or use ' +
|
||||
'`props.dangerouslySetInnerHTML`.'
|
||||
'input is a void element tag and must neither have `children` nor use ' +
|
||||
'`dangerouslySetInnerHTML`.'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -987,8 +987,8 @@ describe('ReactDOMComponent', function() {
|
||||
container
|
||||
);
|
||||
}).toThrowError(
|
||||
'input is a void element tag and must not have `children` or use ' +
|
||||
'`props.dangerouslySetInnerHTML`.'
|
||||
'input is a void element tag and must neither have `children` nor use ' +
|
||||
'`dangerouslySetInnerHTML`.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user