Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword invariant message about empty tags (fixes #7065) #7066

Merged
merged 5 commits into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' +
Expand Down
24 changes: 12 additions & 12 deletions src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.'
);
});

Expand All @@ -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`.'
);
});

Expand All @@ -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`.'
);

});
Expand Down Expand Up @@ -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.'
);
});

Expand Down Expand Up @@ -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`.'
);
});

Expand All @@ -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`.'
);
});

Expand Down