From a3e41dc8964fec620a5e4ddcf9f112c649954592 Mon Sep 17 00:00:00 2001 From: richiethomas <=> Date: Fri, 13 Jan 2017 10:57:40 -0500 Subject: [PATCH] Added double newline delimiters to the following functions/files: * 'beginLifeCycleTimer' function of ReactDebugTool.js * 'bindAutoBindMethod' function of ReactClass.js * 'warnNoop' function of ReactServerUpdateQueue.js * 'getInternalInstanceReadyForUpdate' function of ReactUpdateQueue.js * 'warnNoop' function of ReactNoopUpdateQueue.js * 'getDeclarationErrorAddendum' function of ReactDOMComponent.js * 'getSourceInfoErrorAddendum' function of ReactElementValidator.js * 'getDeclarationErrorAddendum' function of instantiateReactComponent.js and ReactElementValidator.js * 'traverseAllChildrenImpl' function of traverseAllChildren.js * 'attachRef' function of ReactRef.js * 'mountIndeterminateComponent' function of ReactFiberBeginWork.js * 'createFiberFromElementType' function of ReactFiber.js * 'getDeclarationErrorAddendum' function of ReactDOMSelect.js * 'unmountComponentAtNode' function of ReactMount.js * 'getDeclarationErrorAddendum' function of ReactControlledValuePropTypes.js * 'checkRenderMessage' function of CSSPropertyOperations.js * 'getDeclarationErrorAddendum' function of ReactDomFiberSelect.js * 'getCurrentComponentErrorInfo' function in 'ReactElementValidator' * 'getDeclarationErrorAddendum' function in ReactDOMFiberComponent.js --- src/addons/__tests__/ReactFragment-test.js | 2 +- src/isomorphic/classic/class/ReactClass.js | 4 +-- .../classic/class/__tests__/ReactBind-test.js | 2 +- .../classic/element/ReactElementValidator.js | 6 ++-- .../__tests__/ReactElementValidator-test.js | 14 +++++----- .../modern/class/ReactNoopUpdateQueue.js | 2 +- .../ReactJSXElementValidator-test.js | 20 ++++++------- .../dom/fiber/ReactDOMFiberComponent.js | 2 +- .../dom/fiber/wrappers/ReactDOMFiberSelect.js | 2 +- .../dom/shared/CSSPropertyOperations.js | 2 +- .../__tests__/CSSPropertyOperations-test.js | 28 +++++++++---------- .../__tests__/ReactDOMComponent-test.js | 6 ++-- .../__tests__/ReactServerRendering-test.js | 6 ++-- .../dom/shared/__tests__/findDOMNode-test.js | 2 +- src/renderers/dom/shared/findDOMNode.js | 2 +- .../utils/ReactControlledValuePropTypes.js | 2 +- .../dom/stack/client/ReactDOMComponent.js | 2 +- src/renderers/dom/stack/client/ReactMount.js | 4 +-- .../stack/client/wrappers/ReactDOMSelect.js | 2 +- .../stack/server/ReactServerUpdateQueue.js | 2 +- src/renderers/shared/ReactDebugTool.js | 4 +-- src/renderers/shared/fiber/ReactFiber.js | 2 +- .../shared/fiber/ReactFiberBeginWork.js | 2 +- .../ReactIncrementalErrorHandling-test.js | 4 +-- .../ReactIncrementalSideEffects-test.js | 2 +- .../shared/__tests__/ReactComponent-test.js | 2 +- .../__tests__/ReactComponentLifeCycle-test.js | 2 +- .../__tests__/ReactCompositeComponent-test.js | 6 ++-- .../shared/__tests__/ReactMultiChild-test.js | 2 +- .../__tests__/ReactStatelessComponent-test.js | 4 +-- .../shared/stack/reconciler/ReactRef.js | 2 +- .../stack/reconciler/ReactUpdateQueue.js | 2 +- .../reconciler/instantiateReactComponent.js | 2 +- .../__tests__/ReactTestRenderer-test.js | 2 +- src/shared/utils/traverseAllChildren.js | 4 +-- 35 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/addons/__tests__/ReactFragment-test.js b/src/addons/__tests__/ReactFragment-test.js index 4788c06e2f3d..f46f45e27a56 100644 --- a/src/addons/__tests__/ReactFragment-test.js +++ b/src/addons/__tests__/ReactFragment-test.js @@ -55,7 +55,7 @@ describe('ReactFragment', () => { 'Objects are not valid as a React child (found: object with keys ' + '{a, b, c}). If you meant to render a collection of children, use an ' + 'array instead or wrap the object using createFragment(object) from ' + - 'the React add-ons. Check the render method of `Foo`.' + 'the React add-ons.\n\nCheck the render method of `Foo`.' ); }); diff --git a/src/isomorphic/classic/class/ReactClass.js b/src/isomorphic/classic/class/ReactClass.js index f7cc206fd0f5..0a49cae1e6b4 100644 --- a/src/isomorphic/classic/class/ReactClass.js +++ b/src/isomorphic/classic/class/ReactClass.js @@ -677,7 +677,7 @@ function bindAutoBindMethod(component, method) { warning( false, 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', + 'component instance.\n\nSee %s', componentName ); } else if (!args.length) { @@ -685,7 +685,7 @@ function bindAutoBindMethod(component, method) { false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', + 'way, so you can safely remove this call.\n\nSee %s', componentName ); return boundMethod; diff --git a/src/isomorphic/classic/class/__tests__/ReactBind-test.js b/src/isomorphic/classic/class/__tests__/ReactBind-test.js index 4056a39ae4a7..61e63a2670ba 100644 --- a/src/isomorphic/classic/class/__tests__/ReactBind-test.js +++ b/src/isomorphic/classic/class/__tests__/ReactBind-test.js @@ -127,7 +127,7 @@ describe('autobinding', () => { expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See TestBindComponent' + 'way, so you can safely remove this call.\n\nSee TestBindComponent' ); }); diff --git a/src/isomorphic/classic/element/ReactElementValidator.js b/src/isomorphic/classic/element/ReactElementValidator.js index f3910590dca5..121d580ca596 100644 --- a/src/isomorphic/classic/element/ReactElementValidator.js +++ b/src/isomorphic/classic/element/ReactElementValidator.js @@ -33,7 +33,7 @@ function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentName(ReactCurrentOwner.current); if (name) { - return ' Check the render method of `' + name + '`.'; + return '\n\nCheck the render method of `' + name + '`.'; } } return ''; @@ -48,7 +48,7 @@ function getSourceInfoErrorAddendum(elementProps) { var source = elementProps.__source; var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; - return ' Check your code at ' + fileName + ':' + lineNumber + '.'; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } @@ -67,7 +67,7 @@ function getCurrentComponentErrorInfo(parentType) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { - info = ` Check the top-level render call using <${parentName}>.`; + info = `\n\nCheck the top-level render call using <${parentName}>.`; } } return info; diff --git a/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js b/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js index 4347b8b78b0a..6906eb16a9dc 100644 --- a/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js +++ b/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js @@ -76,8 +76,8 @@ describe('ReactElementValidator', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Each child in an array or iterator should have a unique "key" prop. ' + - 'Check the render method of `InnerClass`. ' + + 'Each child in an array or iterator should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerClass`. ' + 'It was passed a child from ComponentWrapper. ' ); }); @@ -118,7 +118,7 @@ describe('ReactElementValidator', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Each child in an array or iterator should have a unique ' + - '"key" prop. Check the top-level render call using
. See ' + + '"key" prop.\n\nCheck the top-level render call using
. See ' + 'https://fb.me/react-warning-keys for more information.\n' + ' in div (at **)' ); @@ -150,7 +150,7 @@ describe('ReactElementValidator', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Each child in an array or iterator should have a unique ' + - '"key" prop. Check the render method of `Component`. See ' + + '"key" prop.\n\nCheck the render method of `Component`. See ' + 'https://fb.me/react-warning-keys for more information.\n' + ' in div (at **)\n' + ' in Component (at **)\n' + @@ -342,14 +342,14 @@ describe('ReactElementValidator', () => { ReactTestUtils.renderIntoDocument(React.createElement(ParentComp)); }).toThrowError( 'Element type is invalid: expected a string (for built-in components) ' + - 'or a class/function (for composite components) but got: null. Check ' + + 'or a class/function (for composite components) but got: null.\n\nCheck ' + 'the render method of `ParentComp`.' ); expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + - 'components) but got: null. Check the render method of `ParentComp`.' + + 'components) but got: null.\n\nCheck the render method of `ParentComp`.' + '\n in ParentComp' ); }); @@ -551,7 +551,7 @@ describe('ReactElementValidator', () => { 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + 'components) but got: undefined. You likely forgot to export your ' + - 'component from the file it\'s defined in. Check your code at **.' + 'component from the file it\'s defined in.\n\nCheck your code at **.' ); }); diff --git a/src/isomorphic/modern/class/ReactNoopUpdateQueue.js b/src/isomorphic/modern/class/ReactNoopUpdateQueue.js index 7e657e142539..949ed73ca60c 100644 --- a/src/isomorphic/modern/class/ReactNoopUpdateQueue.js +++ b/src/isomorphic/modern/class/ReactNoopUpdateQueue.js @@ -20,7 +20,7 @@ function warnNoop(publicInstance, callerName) { false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + - 'This is a no-op. Please check the code for the %s component.', + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass' diff --git a/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js b/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js index 5819b2fa9562..e29b8acd1628 100644 --- a/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js +++ b/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js @@ -82,8 +82,8 @@ describe('ReactJSXElementValidator', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Each child in an array or iterator should have a unique "key" prop. ' + - 'Check the render method of `InnerComponent`. ' + + 'Each child in an array or iterator should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerComponent`. ' + 'It was passed a child from ComponentWrapper. ' ); }); @@ -260,26 +260,26 @@ describe('ReactJSXElementValidator', () => { 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + 'components) but got: undefined. You likely forgot to export your ' + - 'component from the file it\'s defined in. ' + - 'Check your code at **.' + 'component from the file it\'s defined in.' + + '\n\nCheck your code at **.' ); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(1)[0])).toBe( 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + - 'components) but got: null. ' + - 'Check your code at **.' + 'components) but got: null.' + + '\n\nCheck your code at **.' ); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(2)[0])).toBe( 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + - 'components) but got: boolean. ' + - 'Check your code at **.' + 'components) but got: boolean.' + + '\n\nCheck your code at **.' ); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(3)[0])).toBe( 'Warning: React.createElement: type is invalid -- expected a string ' + '(for built-in components) or a class/function (for composite ' + - 'components) but got: number. ' + - 'Check your code at **.' + 'components) but got: number.' + + '\n\nCheck your code at **.' ); void
; expectDev(console.error.calls.count()).toBe(4); diff --git a/src/renderers/dom/fiber/ReactDOMFiberComponent.js b/src/renderers/dom/fiber/ReactDOMFiberComponent.js index f75c0ad9ebb2..a5555cb747af 100644 --- a/src/renderers/dom/fiber/ReactDOMFiberComponent.js +++ b/src/renderers/dom/fiber/ReactDOMFiberComponent.js @@ -68,7 +68,7 @@ function getDeclarationErrorAddendum() { var ownerName = getCurrentFiberOwnerName(); if (ownerName) { // TODO: also report the stack. - return ' This DOM node was rendered by `' + ownerName + '`.'; + return '\n\nThis DOM node was rendered by `' + ownerName + '`.'; } return ''; } diff --git a/src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js b/src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js index 195a0e610592..88853b301471 100644 --- a/src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js +++ b/src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js @@ -28,7 +28,7 @@ var didWarnValueDefaultValue = false; function getDeclarationErrorAddendum() { var ownerName = getCurrentFiberOwnerName(); if (ownerName) { - return ' Check the render method of `' + ownerName + '`.'; + return '\n\nCheck the render method of `' + ownerName + '`.'; } return ''; } diff --git a/src/renderers/dom/shared/CSSPropertyOperations.js b/src/renderers/dom/shared/CSSPropertyOperations.js index c970007bf7a6..81858e997b68 100644 --- a/src/renderers/dom/shared/CSSPropertyOperations.js +++ b/src/renderers/dom/shared/CSSPropertyOperations.js @@ -128,7 +128,7 @@ if (__DEV__) { // TODO: also report the stack. } if (ownerName) { - return ' Check the render method of `' + ownerName + '`.'; + return '\n\nCheck the render method of `' + ownerName + '`.'; } return ''; }; diff --git a/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js b/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js index ee78a6756128..850e727a79bc 100644 --- a/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js +++ b/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js @@ -121,8 +121,8 @@ describe('CSSPropertyOperations', () => { ReactDOM.render(, root); expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toEqual( - 'Warning: Unsupported style property background-color. Did you mean backgroundColor? ' + - 'Check the render method of `Comp`.' + 'Warning: Unsupported style property background-color. Did you mean backgroundColor?' + + '\n\nCheck the render method of `Comp`.' ); }); @@ -146,12 +146,12 @@ describe('CSSPropertyOperations', () => { expectDev(console.error.calls.count()).toBe(2); expectDev(console.error.calls.argsFor(0)[0]).toEqual( - 'Warning: Unsupported style property -ms-transform. Did you mean msTransform? ' + - 'Check the render method of `Comp`.' + 'Warning: Unsupported style property -ms-transform. Did you mean msTransform?' + + '\n\nCheck the render method of `Comp`.' ); expectDev(console.error.calls.argsFor(1)[0]).toEqual( - 'Warning: Unsupported style property -webkit-transform. Did you mean WebkitTransform? ' + - 'Check the render method of `Comp`.' + 'Warning: Unsupported style property -webkit-transform. Did you mean WebkitTransform?' + + '\n\nCheck the render method of `Comp`.' ); }); @@ -175,11 +175,11 @@ describe('CSSPropertyOperations', () => { expectDev(console.error.calls.count()).toBe(2); expectDev(console.error.calls.argsFor(0)[0]).toEqual( 'Warning: Unsupported vendor-prefixed style property oTransform. ' + - 'Did you mean OTransform? Check the render method of `Comp`.' + 'Did you mean OTransform?\n\nCheck the render method of `Comp`.' ); expectDev(console.error.calls.argsFor(1)[0]).toEqual( 'Warning: Unsupported vendor-prefixed style property webkitTransform. ' + - 'Did you mean WebkitTransform? Check the render method of `Comp`.' + 'Did you mean WebkitTransform?\n\nCheck the render method of `Comp`.' ); }); @@ -202,12 +202,12 @@ describe('CSSPropertyOperations', () => { ReactDOM.render(, root); expectDev(console.error.calls.count()).toBe(2); expectDev(console.error.calls.argsFor(0)[0]).toEqual( - 'Warning: Style property values shouldn\'t contain a semicolon. ' + - 'Check the render method of `Comp`. Try "backgroundColor: blue" instead.', + 'Warning: Style property values shouldn\'t contain a semicolon.' + + '\n\nCheck the render method of `Comp`. Try "backgroundColor: blue" instead.', ); expectDev(console.error.calls.argsFor(1)[0]).toEqual( - 'Warning: Style property values shouldn\'t contain a semicolon. ' + - 'Check the render method of `Comp`. Try "color: red" instead.', + 'Warning: Style property values shouldn\'t contain a semicolon.' + + '\n\nCheck the render method of `Comp`. Try "color: red" instead.', ); }); @@ -226,8 +226,8 @@ describe('CSSPropertyOperations', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toEqual( - 'Warning: `NaN` is an invalid value for the `fontSize` css style property. ' + - 'Check the render method of `Comp`.' + 'Warning: `NaN` is an invalid value for the `fontSize` css style property.' + + '\n\nCheck the render method of `Comp`.' ); }); }); diff --git a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js index 294987ac84d6..e9bf9a0823c5 100644 --- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js +++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js @@ -911,7 +911,7 @@ describe('ReactDOMComponent', () => { container ); }).toThrowError( - 'This DOM node was rendered by `Owner`.' + '\n\nThis DOM node was rendered by `Owner`.' ); }); @@ -1088,7 +1088,7 @@ describe('ReactDOMComponent', () => { ReactDOM.render(, container); }).toThrowError( 'input is a void element tag and must neither have `children` ' + - 'nor use `dangerouslySetInnerHTML`. This DOM node was rendered by `X`.' + 'nor use `dangerouslySetInnerHTML`.\n\nThis DOM node was rendered by `X`.' ); }); @@ -1183,7 +1183,7 @@ describe('ReactDOMComponent', () => { }).toThrowError( 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} ' + - 'when using JSX. This DOM node was rendered by `Animal`.' + 'when using JSX.\n\nThis DOM node was rendered by `Animal`.' ); }); diff --git a/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js b/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js index e57b0105a02b..296bb572b576 100644 --- a/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js +++ b/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js @@ -474,7 +474,7 @@ describe('ReactDOMServer', () => { expectDev(console.error.calls.mostRecent().args[0]).toBe( 'Warning: setState(...): Can only update a mounting component.' + ' This usually means you called setState() outside componentWillMount() on the server.' + - ' This is a no-op. Please check the code for the Foo component.' + ' This is a no-op.\n\nPlease check the code for the Foo component.' ); var markup = ReactDOMServer.renderToStaticMarkup(); expect(markup).toBe('
hello
'); @@ -500,7 +500,7 @@ describe('ReactDOMServer', () => { expectDev(console.error.calls.mostRecent().args[0]).toBe( 'Warning: replaceState(...): Can only update a mounting component. ' + 'This usually means you called replaceState() outside componentWillMount() on the server. ' + - 'This is a no-op. Please check the code for the Bar component.' + 'This is a no-op.\n\nPlease check the code for the Bar component.' ); var markup = ReactDOMServer.renderToStaticMarkup(); expect(markup).toBe('
hello
'); @@ -527,7 +527,7 @@ describe('ReactDOMServer', () => { expectDev(console.error.calls.mostRecent().args[0]).toBe( 'Warning: forceUpdate(...): Can only update a mounting component. ' + 'This usually means you called forceUpdate() outside componentWillMount() on the server. ' + - 'This is a no-op. Please check the code for the Baz component.' + 'This is a no-op.\n\nPlease check the code for the Baz component.' ); var markup = ReactDOMServer.renderToStaticMarkup(); expect(markup).toBe('
'); diff --git a/src/renderers/dom/shared/__tests__/findDOMNode-test.js b/src/renderers/dom/shared/__tests__/findDOMNode-test.js index e7f7aba6d3a1..6ede9820d55d 100644 --- a/src/renderers/dom/shared/__tests__/findDOMNode-test.js +++ b/src/renderers/dom/shared/__tests__/findDOMNode-test.js @@ -64,7 +64,7 @@ describe('findDOMNode', () => { expect(function() { ReactDOM.findDOMNode({foo: 'bar'}); }).toThrowError( - 'Element appears to be neither ReactComponent nor DOMNode (keys: foo)' + 'Element appears to be neither ReactComponent nor DOMNode. Keys: foo' ); }); diff --git a/src/renderers/dom/shared/findDOMNode.js b/src/renderers/dom/shared/findDOMNode.js index b4d1bf21befc..f932f0898740 100644 --- a/src/renderers/dom/shared/findDOMNode.js +++ b/src/renderers/dom/shared/findDOMNode.js @@ -64,7 +64,7 @@ const findDOMNode = function(componentOrElement : Element | ?ReactComponent, callerName: str false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + - 'This is a no-op. Please check the code for the %s component.', + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass' diff --git a/src/renderers/shared/ReactDebugTool.js b/src/renderers/shared/ReactDebugTool.js index 7dc78d727be1..fa2f68bddeb5 100644 --- a/src/renderers/shared/ReactDebugTool.js +++ b/src/renderers/shared/ReactDebugTool.js @@ -174,8 +174,8 @@ if (__DEV__) { if (currentTimerType && !lifeCycleTimerHasWarned) { warning( false, - 'There is an internal error in the React performance measurement code. ' + - 'Did not expect %s timer to start while %s timer is still in ' + + 'There is an internal error in the React performance measurement code.' + + '\n\nDid not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', diff --git a/src/renderers/shared/fiber/ReactFiber.js b/src/renderers/shared/fiber/ReactFiber.js index 3657d087bb8c..faee970d8782 100644 --- a/src/renderers/shared/fiber/ReactFiber.js +++ b/src/renderers/shared/fiber/ReactFiber.js @@ -368,7 +368,7 @@ function createFiberFromElementType(type : mixed, key : null | string, debugOwne } const ownerName = debugOwner ? getComponentName(debugOwner) : null; if (ownerName) { - info += ' Check the render method of `' + ownerName + '`.'; + info += '\n\nCheck the render method of `' + ownerName + '`.'; } } invariant( diff --git a/src/renderers/shared/fiber/ReactFiberBeginWork.js b/src/renderers/shared/fiber/ReactFiberBeginWork.js index afe933c0503a..5cd3f277831a 100644 --- a/src/renderers/shared/fiber/ReactFiberBeginWork.js +++ b/src/renderers/shared/fiber/ReactFiberBeginWork.js @@ -478,7 +478,7 @@ module.exports = function( let info = ''; const ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName(); if (ownerName) { - info += ' Check the render method of `' + ownerName + '`.'; + info += '\n\nCheck the render method of `' + ownerName + '`.'; } let warningKey = ownerName || workInProgress._debugID || ''; diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js index 603ab8c7fd26..1b9aecc55747 100644 --- a/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js +++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js @@ -754,7 +754,7 @@ describe('ReactIncrementalErrorHandling', () => { 'Element type is invalid: expected a string (for built-in components) or ' + 'a class/function (for composite components) but got: undefined. ' + 'You likely forgot to export your component from the file it\'s ' + - 'defined in. Check the render method of `BrokenRender`.' + 'defined in.\n\nCheck the render method of `BrokenRender`.' )]); expect(console.error.calls.count()).toBe(1); }); @@ -797,7 +797,7 @@ describe('ReactIncrementalErrorHandling', () => { 'Element type is invalid: expected a string (for built-in components) or ' + 'a class/function (for composite components) but got: undefined. ' + 'You likely forgot to export your component from the file it\'s ' + - 'defined in. Check the render method of `BrokenRender`.' + 'defined in.\n\nCheck the render method of `BrokenRender`.' )]); expect(console.error.calls.count()).toBe(1); }); diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js index f8b46fa18667..83e51b3611c3 100644 --- a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js +++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js @@ -1135,7 +1135,7 @@ describe('ReactIncrementalSideEffects', () => { expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Stateless function components cannot be given refs. ' + - 'Attempts to access this ref will fail. Check the render method ' + + 'Attempts to access this ref will fail.\n\nCheck the render method ' + 'of `Foo`.\n' + ' in FunctionalComponent (at **)\n' + ' in div (at **)\n' + diff --git a/src/renderers/shared/shared/__tests__/ReactComponent-test.js b/src/renderers/shared/shared/__tests__/ReactComponent-test.js index 5c2ba86a41d5..024a729a392f 100644 --- a/src/renderers/shared/shared/__tests__/ReactComponent-test.js +++ b/src/renderers/shared/shared/__tests__/ReactComponent-test.js @@ -370,7 +370,7 @@ describe('ReactComponent', () => { 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: undefined. ' + 'You likely forgot to export your component from the file it\'s ' + - 'defined in. Check the render method of `Bar`.' + 'defined in.\n\nCheck the render method of `Bar`.' ); // One warning for each element creation diff --git a/src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js b/src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js index 3f4cbbd2060e..8497d33a7069 100644 --- a/src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js +++ b/src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js @@ -237,7 +237,7 @@ describe('ReactComponentLifeCycle', () => { expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: setState(...): Can only update a mounted or ' + 'mounting component. This usually means you called setState() on an ' + - 'unmounted component. This is a no-op. Please check the code for the ' + + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' + 'StatefulComponent component.' ); }); diff --git a/src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js b/src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js index af226d2f2297..48250101c030 100644 --- a/src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js +++ b/src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js @@ -280,7 +280,7 @@ describe('ReactCompositeComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: forceUpdate(...): Can only update a mounted or ' + 'mounting component. This usually means you called forceUpdate() on an ' + - 'unmounted component. This is a no-op. Please check the code for the ' + + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' + 'Component component.' ); }); @@ -324,7 +324,7 @@ describe('ReactCompositeComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: setState(...): Can only update a mounted or ' + 'mounting component. This usually means you called setState() on an ' + - 'unmounted component. This is a no-op. Please check the code for the ' + + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' + 'Component component.' ); }); @@ -1033,7 +1033,7 @@ describe('ReactCompositeComponent', () => { 'Warning: _renderNewRootComponent(): Render methods should ' + 'be a pure function of props and state; triggering nested component ' + 'updates from render is not allowed. If necessary, trigger nested ' + - 'updates in componentDidUpdate. Check the render method of Outer.' + 'updates in componentDidUpdate.\n\nCheck the render method of Outer.' ); }); diff --git a/src/renderers/shared/shared/__tests__/ReactMultiChild-test.js b/src/renderers/shared/shared/__tests__/ReactMultiChild-test.js index c2756a9be965..3b604cd3735f 100644 --- a/src/renderers/shared/shared/__tests__/ReactMultiChild-test.js +++ b/src/renderers/shared/shared/__tests__/ReactMultiChild-test.js @@ -280,7 +280,7 @@ describe('ReactMultiChild', () => { expectDev(console.error.calls.argsFor(0)[0]).toBe( 'Warning: Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a sequence ' + - '/ iterable of keyed ReactElements instead. Check the render method of `Parent`.' + '/ iterable of keyed ReactElements instead.\n\nCheck the render method of `Parent`.' ); }); }); diff --git a/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js b/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js index 876f26855481..dc71f5026453 100644 --- a/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js +++ b/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js @@ -189,7 +189,7 @@ describe('ReactStatelessComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Stateless function components cannot be given refs. ' + - 'Attempts to access this ref will fail. Check the render method ' + + 'Attempts to access this ref will fail.\n\nCheck the render method ' + 'of `ParentUsingStringRef`.\n' + ' in StatelessComponent (at **)\n' + ' in div (at **)\n' + @@ -224,7 +224,7 @@ describe('ReactStatelessComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Stateless function components cannot be given refs. ' + - 'Attempts to access this ref will fail. Check the render method ' + + 'Attempts to access this ref will fail.\n\nCheck the render method ' + 'of `ParentUsingFunctionRef`.\n' + ' in StatelessComponent (at **)\n' + ' in div (at **)\n' + diff --git a/src/renderers/shared/stack/reconciler/ReactRef.js b/src/renderers/shared/stack/reconciler/ReactRef.js index 6e1d3681b9bf..54167d2c7d55 100644 --- a/src/renderers/shared/stack/reconciler/ReactRef.js +++ b/src/renderers/shared/stack/reconciler/ReactRef.js @@ -37,7 +37,7 @@ function attachRef(ref, component, owner) { ownerName = owner.getName(); } if (ownerName) { - info += ' Check the render method of `' + ownerName + '`.'; + info += '\n\nCheck the render method of `' + ownerName + '`.'; } } diff --git a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js index 72d3e6507328..a9bed9832c2b 100644 --- a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js @@ -35,7 +35,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { !callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + - 'This is a no-op. Please check the code for the %s component.', + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass' diff --git a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js index d1b5c23262c6..651d16982e77 100644 --- a/src/renderers/shared/stack/reconciler/instantiateReactComponent.js +++ b/src/renderers/shared/stack/reconciler/instantiateReactComponent.js @@ -35,7 +35,7 @@ function getDeclarationErrorAddendum(owner) { if (owner) { var name = owner.getName(); if (name) { - return ' Check the render method of `' + name + '`.'; + return '\n\nCheck the render method of `' + name + '`.'; } } return ''; diff --git a/src/renderers/testing/__tests__/ReactTestRenderer-test.js b/src/renderers/testing/__tests__/ReactTestRenderer-test.js index 584453d08615..fda64cb2afb1 100644 --- a/src/renderers/testing/__tests__/ReactTestRenderer-test.js +++ b/src/renderers/testing/__tests__/ReactTestRenderer-test.js @@ -262,7 +262,7 @@ describe('ReactTestRenderer', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe( 'Warning: Stateless function components cannot be given refs. Attempts ' + - 'to access this ref will fail. Check the render method of `Foo`.\n' + + 'to access this ref will fail.\n\nCheck the render method of `Foo`.\n' + ' in Bar (at **)\n' + ' in Foo (at **)' ); diff --git a/src/shared/utils/traverseAllChildren.js b/src/shared/utils/traverseAllChildren.js index 60b5f147aabf..dd421d632ce1 100644 --- a/src/shared/utils/traverseAllChildren.js +++ b/src/shared/utils/traverseAllChildren.js @@ -129,7 +129,7 @@ function traverseAllChildrenImpl( if (ReactCurrentOwner.current) { var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; + mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.'; } } warning( @@ -175,7 +175,7 @@ function traverseAllChildrenImpl( if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); if (name) { - addendum += ' Check the render method of `' + name + '`.'; + addendum += '\n\nCheck the render method of `' + name + '`.'; } } }