diff --git a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js index b140a31301993..58be0dd655f45 100644 --- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js +++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js @@ -1126,7 +1126,12 @@ describe('ReactDOMComponent', () => { spyOn(console, 'error'); mountComponent({contentEditable: true, children: ''}); expectDev(console.error.calls.count()).toBe(1); - expectDev(console.error.calls.argsFor(0)[0]).toContain('contentEditable'); + expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( + 'Warning: A component is `contentEditable` and contains `children` ' + + 'managed by React. It is now your responsibility to guarantee that ' + + 'none of those nodes are unexpectedly modified or duplicated. This ' + + 'is probably not intentional.\n in div (at **)', + ); }); it('should respect suppressContentEditableWarning', () => { diff --git a/src/renderers/dom/shared/utils/assertValidProps.js b/src/renderers/dom/shared/utils/assertValidProps.js index 6fbcb84ab7285..7170e7ff76a3e 100644 --- a/src/renderers/dom/shared/utils/assertValidProps.js +++ b/src/renderers/dom/shared/utils/assertValidProps.js @@ -13,6 +13,7 @@ var invariant = require('fbjs/lib/invariant'); var voidElementTags = require('voidElementTags'); if (__DEV__) { + var {getCurrentFiberStackAddendum} = require('ReactDebugCurrentFiber'); var warning = require('fbjs/lib/warning'); } @@ -68,7 +69,8 @@ function assertValidProps( 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + - 'probably not intentional.', + 'probably not intentional.%s', + getCurrentFiberStackAddendum() || '', ); } invariant(