Skip to content
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
10 changes: 2 additions & 8 deletions src/core/ReactMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,11 @@ var ReactMount = {

firstChildren.length = 0;

if (__DEV__) {
console.error(
'Error while invoking `findComponentRoot` with the following ' +
'ancestor node:',
ancestorNode
);
}
invariant(
false,
'findComponentRoot(..., %s): Unable to find element. This probably ' +
'means the DOM was unexpectedly mutated (e.g. by the browser).',
'means the DOM was unexpectedly mutated (e.g., by the browser). ' +
'Try inspecting the child nodes of the element with React ID `%s`.',
id,
ReactMount.getID(ancestorNode)
);
Expand Down
8 changes: 2 additions & 6 deletions src/core/__tests__/ReactInstanceHandles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ describe('ReactInstanceHandles', function() {
ReactMount.getID(childNodeB)
)).toBe(childNodeB);

spyOn(console, 'error');
expect(console.error.argsForCall.length).toBe(0);

expect(function() {
ReactMount.findComponentRoot(
parentNode,
Expand All @@ -149,10 +146,9 @@ describe('ReactInstanceHandles', function() {
}).toThrow(
'Invariant Violation: findComponentRoot(..., .react[0].1:0:junk): ' +
'Unable to find element. This probably means the DOM was ' +
'unexpectedly mutated (e.g. by the browser).'
'unexpectedly mutated (e.g., by the browser). Try inspecting the ' +
'child nodes of the element with React ID `.react[0]`.'
);

expect(console.error.argsForCall.length).toBe(1);
});
});

Expand Down