mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
More actionable error message for <tbody> and nested <p>
This bites people all of the time. Until we have a better solution, let's just make the error message more actionable (most people don't know how the DOM gets unexpectedly mutated).
This commit is contained in:
committed by
Paul O’Shannessy
parent
9b427a322f
commit
04f9887f0e
@@ -618,8 +618,10 @@ var ReactMount = {
|
||||
invariant(
|
||||
false,
|
||||
'findComponentRoot(..., %s): Unable to find element. This probably ' +
|
||||
'means the DOM was unexpectedly mutated (e.g., by the browser). ' +
|
||||
'Try inspecting the child nodes of the element with React ID `%s`.',
|
||||
'means the DOM was unexpectedly mutated (e.g., by the browser), ' +
|
||||
'usually due to forgetting a <tbody> when using tables or nesting <p> ' +
|
||||
'or <a> tags. Try inspecting the child nodes of the element with React ' +
|
||||
'ID `%s`.',
|
||||
targetID,
|
||||
ReactMount.getID(ancestorNode)
|
||||
);
|
||||
|
||||
@@ -146,8 +146,10 @@ describe('ReactInstanceHandles', function() {
|
||||
}).toThrow(
|
||||
'Invariant Violation: findComponentRoot(..., .0.1:0:junk): ' +
|
||||
'Unable to find element. This probably means the DOM was ' +
|
||||
'unexpectedly mutated (e.g., by the browser). Try inspecting the ' +
|
||||
'child nodes of the element with React ID `.0`.'
|
||||
'unexpectedly mutated (e.g., by the browser), usually due to ' +
|
||||
'forgetting a <tbody> when using tables or nesting <p> or <a> ' +
|
||||
'tags. Try inspecting the child nodes of the element with React ' +
|
||||
'ID `.0`.'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user