@samitouri / QOS-React / commits / 469e68542b

Added double newline delimiters to the following functions/files: (#8777)

Added double newline delimiters to the following functions/files: (#8777) * '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

Richie Thomas committed Jan 31, 2017 at 08:41 UTC 469e68542b0c12d3c3a8ffbed664bd87fb6eadcf
35 files changed +77 -77
src/addons/__tests__/ReactFragment-test.js
+1 -1
@@ -55,7 +55,7 @@ describe('ReactFragment', () => {
55 'Objects are not valid as a React child (found: object with keys ' +
56 '{a, b, c}). If you meant to render a collection of children, use an ' +
57 'array instead or wrap the object using createFragment(object) from ' +
58 - 'the React add-ons. Check the render method of `Foo`.'
58 + 'the React add-ons.\n\nCheck the render method of `Foo`.'
59 );
60 });
61
src/isomorphic/classic/class/ReactClass.js
+2 -2
@@ -676,7 +676,7 @@ function bindAutoBindMethod(component, method) {
676 warning(
677 false,
678 'bind(): React component methods may only be bound to the ' +
679 - 'component instance. See %s',
679 + 'component instance.\n\nSee %s',
680 componentName
681 );
682 } else if (!args.length) {
@@ -684,7 +684,7 @@ function bindAutoBindMethod(component, method) {
684 false,
685 'bind(): You are binding a component method to the component. ' +
686 'React does this for you automatically in a high-performance ' +
687 - 'way, so you can safely remove this call. See %s',
687 + 'way, so you can safely remove this call.\n\nSee %s',
688 componentName
689 );
690 return boundMethod;
src/isomorphic/classic/class/__tests__/ReactBind-test.js
+1 -1
@@ -127,7 +127,7 @@ describe('autobinding', () => {
127 expectDev(console.error.calls.argsFor(0)[0]).toBe(
128 'Warning: bind(): You are binding a component method to the component. ' +
129 'React does this for you automatically in a high-performance ' +
130 - 'way, so you can safely remove this call. See TestBindComponent'
130 + 'way, so you can safely remove this call.\n\nSee TestBindComponent'
131 );
132 });
133
src/isomorphic/classic/element/ReactElementValidator.js
+3 -3
@@ -33,7 +33,7 @@ function getDeclarationErrorAddendum() {
33 if (ReactCurrentOwner.current) {
34 var name = getComponentName(ReactCurrentOwner.current);
35 if (name) {
36 - return ' Check the render method of `' + name + '`.';
36 + return '\n\nCheck the render method of `' + name + '`.';
37 }
38 }
39 return '';
@@ -48,7 +48,7 @@ function getSourceInfoErrorAddendum(elementProps) {
48 var source = elementProps.__source;
49 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
50 var lineNumber = source.lineNumber;
51 - return ' Check your code at ' + fileName + ':' + lineNumber + '.';
51 + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
52 }
53 return '';
54 }
@@ -67,7 +67,7 @@ function getCurrentComponentErrorInfo(parentType) {
67 var parentName = typeof parentType === 'string' ?
68 parentType : parentType.displayName || parentType.name;
69 if (parentName) {
70 - info = ` Check the top-level render call using <${parentName}>.`;
70 + info = `\n\nCheck the top-level render call using <${parentName}>.`;
71 }
72 }
73 return info;
src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js
+7 -7
@@ -76,8 +76,8 @@ describe('ReactElementValidator', () => {
76
77 expectDev(console.error.calls.count()).toBe(1);
78 expectDev(console.error.calls.argsFor(0)[0]).toContain(
79 - 'Each child in an array or iterator should have a unique "key" prop. ' +
80 - 'Check the render method of `InnerClass`. ' +
79 + 'Each child in an array or iterator should have a unique "key" prop.' +
80 + '\n\nCheck the render method of `InnerClass`. ' +
81 'It was passed a child from ComponentWrapper. '
82 );
83 });
@@ -118,7 +118,7 @@ describe('ReactElementValidator', () => {
118 expectDev(console.error.calls.count()).toBe(1);
119 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
120 'Warning: Each child in an array or iterator should have a unique ' +
121 - '"key" prop. Check the top-level render call using <div>. See ' +
121 + '"key" prop.\n\nCheck the top-level render call using <div>. See ' +
122 'https://fb.me/react-warning-keys for more information.\n' +
123 ' in div (at **)'
124 );
@@ -150,7 +150,7 @@ describe('ReactElementValidator', () => {
150 expectDev(console.error.calls.count()).toBe(1);
151 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
152 'Warning: Each child in an array or iterator should have a unique ' +
153 - '"key" prop. Check the render method of `Component`. See ' +
153 + '"key" prop.\n\nCheck the render method of `Component`. See ' +
154 'https://fb.me/react-warning-keys for more information.\n' +
155 ' in div (at **)\n' +
156 ' in Component (at **)\n' +
@@ -342,14 +342,14 @@ describe('ReactElementValidator', () => {
342 ReactTestUtils.renderIntoDocument(React.createElement(ParentComp));
343 }).toThrowError(
344 'Element type is invalid: expected a string (for built-in components) ' +
345 - 'or a class/function (for composite components) but got: null. Check ' +
345 + 'or a class/function (for composite components) but got: null.\n\nCheck ' +
346 'the render method of `ParentComp`.'
347 );
348 expectDev(console.error.calls.count()).toBe(1);
349 expectDev(console.error.calls.argsFor(0)[0]).toBe(
350 'Warning: React.createElement: type is invalid -- expected a string ' +
351 '(for built-in components) or a class/function (for composite ' +
352 - 'components) but got: null. Check the render method of `ParentComp`.' +
352 + 'components) but got: null.\n\nCheck the render method of `ParentComp`.' +
353 '\n in ParentComp'
354 );
355 });
@@ -551,7 +551,7 @@ describe('ReactElementValidator', () => {
551 'Warning: React.createElement: type is invalid -- expected a string ' +
552 '(for built-in components) or a class/function (for composite ' +
553 'components) but got: undefined. You likely forgot to export your ' +
554 - 'component from the file it\'s defined in. Check your code at **.'
554 + 'component from the file it\'s defined in.\n\nCheck your code at **.'
555 );
556 });
557
src/isomorphic/modern/class/ReactNoopUpdateQueue.js
+1 -1
@@ -20,7 +20,7 @@ function warnNoop(publicInstance, callerName) {
20 false,
21 '%s(...): Can only update a mounted or mounting component. ' +
22 'This usually means you called %s() on an unmounted component. ' +
23 - 'This is a no-op. Please check the code for the %s component.',
23 + 'This is a no-op.\n\nPlease check the code for the %s component.',
24 callerName,
25 callerName,
26 constructor && (constructor.displayName || constructor.name) || 'ReactClass'
src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js
+10 -10
@@ -82,8 +82,8 @@ describe('ReactJSXElementValidator', () => {
82
83 expectDev(console.error.calls.count()).toBe(1);
84 expectDev(console.error.calls.argsFor(0)[0]).toContain(
85 - 'Each child in an array or iterator should have a unique "key" prop. ' +
86 - 'Check the render method of `InnerComponent`. ' +
85 + 'Each child in an array or iterator should have a unique "key" prop.' +
86 + '\n\nCheck the render method of `InnerComponent`. ' +
87 'It was passed a child from ComponentWrapper. '
88 );
89 });
@@ -260,26 +260,26 @@ describe('ReactJSXElementValidator', () => {
260 'Warning: React.createElement: type is invalid -- expected a string ' +
261 '(for built-in components) or a class/function (for composite ' +
262 'components) but got: undefined. You likely forgot to export your ' +
263 - 'component from the file it\'s defined in. ' +
264 - 'Check your code at **.'
263 + 'component from the file it\'s defined in.' +
264 + '\n\nCheck your code at **.'
265 );
266 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(1)[0])).toBe(
267 'Warning: React.createElement: type is invalid -- expected a string ' +
268 '(for built-in components) or a class/function (for composite ' +
269 - 'components) but got: null. ' +
270 - 'Check your code at **.'
269 + 'components) but got: null.' +
270 + '\n\nCheck your code at **.'
271 );
272 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(2)[0])).toBe(
273 'Warning: React.createElement: type is invalid -- expected a string ' +
274 '(for built-in components) or a class/function (for composite ' +
275 - 'components) but got: boolean. ' +
276 - 'Check your code at **.'
275 + 'components) but got: boolean.' +
276 + '\n\nCheck your code at **.'
277 );
278 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(3)[0])).toBe(
279 'Warning: React.createElement: type is invalid -- expected a string ' +
280 '(for built-in components) or a class/function (for composite ' +
281 - 'components) but got: number. ' +
282 - 'Check your code at **.'
281 + 'components) but got: number.' +
282 + '\n\nCheck your code at **.'
283 );
284 void <Div />;
285 expectDev(console.error.calls.count()).toBe(4);
src/renderers/dom/fiber/ReactDOMFiberComponent.js
+1 -1
@@ -68,7 +68,7 @@ function getDeclarationErrorAddendum() {
68 var ownerName = getCurrentFiberOwnerName();
69 if (ownerName) {
70 // TODO: also report the stack.
71 - return ' This DOM node was rendered by `' + ownerName + '`.';
71 + return '\n\nThis DOM node was rendered by `' + ownerName + '`.';
72 }
73 return '';
74 }
src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js
+1 -1
@@ -28,7 +28,7 @@ var didWarnValueDefaultValue = false;
28 function getDeclarationErrorAddendum() {
29 var ownerName = getCurrentFiberOwnerName();
30 if (ownerName) {
31 - return ' Check the render method of `' + ownerName + '`.';
31 + return '\n\nCheck the render method of `' + ownerName + '`.';
32 }
33 return '';
34 }
src/renderers/dom/shared/CSSPropertyOperations.js
+1 -1
@@ -128,7 +128,7 @@ if (__DEV__) {
128 // TODO: also report the stack.
129 }
130 if (ownerName) {
131 - return ' Check the render method of `' + ownerName + '`.';
131 + return '\n\nCheck the render method of `' + ownerName + '`.';
132 }
133 return '';
134 };
src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
+14 -14
@@ -121,8 +121,8 @@ describe('CSSPropertyOperations', () => {
121 ReactDOM.render(<Comp />, root);
122 expectDev(console.error.calls.count()).toBe(1);
123 expectDev(console.error.calls.argsFor(0)[0]).toEqual(
124 - 'Warning: Unsupported style property background-color. Did you mean backgroundColor? ' +
125 - 'Check the render method of `Comp`.'
124 + 'Warning: Unsupported style property background-color. Did you mean backgroundColor?' +
125 + '\n\nCheck the render method of `Comp`.'
126 );
127 });
128
@@ -146,12 +146,12 @@ describe('CSSPropertyOperations', () => {
146
147 expectDev(console.error.calls.count()).toBe(2);
148 expectDev(console.error.calls.argsFor(0)[0]).toEqual(
149 - 'Warning: Unsupported style property -ms-transform. Did you mean msTransform? ' +
150 - 'Check the render method of `Comp`.'
149 + 'Warning: Unsupported style property -ms-transform. Did you mean msTransform?' +
150 + '\n\nCheck the render method of `Comp`.'
151 );
152 expectDev(console.error.calls.argsFor(1)[0]).toEqual(
153 - 'Warning: Unsupported style property -webkit-transform. Did you mean WebkitTransform? ' +
154 - 'Check the render method of `Comp`.'
153 + 'Warning: Unsupported style property -webkit-transform. Did you mean WebkitTransform?' +
154 + '\n\nCheck the render method of `Comp`.'
155 );
156 });
157
@@ -175,11 +175,11 @@ describe('CSSPropertyOperations', () => {
175 expectDev(console.error.calls.count()).toBe(2);
176 expectDev(console.error.calls.argsFor(0)[0]).toEqual(
177 'Warning: Unsupported vendor-prefixed style property oTransform. ' +
178 - 'Did you mean OTransform? Check the render method of `Comp`.'
178 + 'Did you mean OTransform?\n\nCheck the render method of `Comp`.'
179 );
180 expectDev(console.error.calls.argsFor(1)[0]).toEqual(
181 'Warning: Unsupported vendor-prefixed style property webkitTransform. ' +
182 - 'Did you mean WebkitTransform? Check the render method of `Comp`.'
182 + 'Did you mean WebkitTransform?\n\nCheck the render method of `Comp`.'
183 );
184 });
185
@@ -202,12 +202,12 @@ describe('CSSPropertyOperations', () => {
202 ReactDOM.render(<Comp />, root);
203 expectDev(console.error.calls.count()).toBe(2);
204 expectDev(console.error.calls.argsFor(0)[0]).toEqual(
205 - 'Warning: Style property values shouldn\'t contain a semicolon. ' +
206 - 'Check the render method of `Comp`. Try "backgroundColor: blue" instead.',
205 + 'Warning: Style property values shouldn\'t contain a semicolon.' +
206 + '\n\nCheck the render method of `Comp`. Try "backgroundColor: blue" instead.',
207 );
208 expectDev(console.error.calls.argsFor(1)[0]).toEqual(
209 - 'Warning: Style property values shouldn\'t contain a semicolon. ' +
210 - 'Check the render method of `Comp`. Try "color: red" instead.',
209 + 'Warning: Style property values shouldn\'t contain a semicolon.' +
210 + '\n\nCheck the render method of `Comp`. Try "color: red" instead.',
211 );
212 });
213
@@ -226,8 +226,8 @@ describe('CSSPropertyOperations', () => {
226
227 expectDev(console.error.calls.count()).toBe(1);
228 expectDev(console.error.calls.argsFor(0)[0]).toEqual(
229 - 'Warning: `NaN` is an invalid value for the `fontSize` css style property. ' +
230 - 'Check the render method of `Comp`.'
229 + 'Warning: `NaN` is an invalid value for the `fontSize` css style property.' +
230 + '\n\nCheck the render method of `Comp`.'
231 );
232 });
233 });
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
+3 -3
@@ -911,7 +911,7 @@ describe('ReactDOMComponent', () => {
911 container
912 );
913 }).toThrowError(
914 - 'This DOM node was rendered by `Owner`.'
914 + '\n\nThis DOM node was rendered by `Owner`.'
915 );
916 });
917
@@ -1088,7 +1088,7 @@ describe('ReactDOMComponent', () => {
1088 ReactDOM.render(<X />, container);
1089 }).toThrowError(
1090 'input is a void element tag and must neither have `children` ' +
1091 - 'nor use `dangerouslySetInnerHTML`. This DOM node was rendered by `X`.'
1091 + 'nor use `dangerouslySetInnerHTML`.\n\nThis DOM node was rendered by `X`.'
1092 );
1093 });
1094
@@ -1183,7 +1183,7 @@ describe('ReactDOMComponent', () => {
1183 }).toThrowError(
1184 'The `style` prop expects a mapping from style properties to values, ' +
1185 'not a string. For example, style={{marginRight: spacing + \'em\'}} ' +
1186 - 'when using JSX. This DOM node was rendered by `Animal`.'
1186 + 'when using JSX.\n\nThis DOM node was rendered by `Animal`.'
1187 );
1188 });
1189
src/renderers/dom/shared/__tests__/ReactServerRendering-test.js
+3 -3
@@ -474,7 +474,7 @@ describe('ReactDOMServer', () => {
474 expectDev(console.error.calls.mostRecent().args[0]).toBe(
475 'Warning: setState(...): Can only update a mounting component.' +
476 ' This usually means you called setState() outside componentWillMount() on the server.' +
477 - ' This is a no-op. Please check the code for the Foo component.'
477 + ' This is a no-op.\n\nPlease check the code for the Foo component.'
478 );
479 var markup = ReactDOMServer.renderToStaticMarkup(<Foo />);
480 expect(markup).toBe('<div>hello</div>');
@@ -500,7 +500,7 @@ describe('ReactDOMServer', () => {
500 expectDev(console.error.calls.mostRecent().args[0]).toBe(
501 'Warning: replaceState(...): Can only update a mounting component. ' +
502 'This usually means you called replaceState() outside componentWillMount() on the server. ' +
503 - 'This is a no-op. Please check the code for the Bar component.'
503 + 'This is a no-op.\n\nPlease check the code for the Bar component.'
504 );
505 var markup = ReactDOMServer.renderToStaticMarkup(<Bar />);
506 expect(markup).toBe('<div>hello</div>');
@@ -527,7 +527,7 @@ describe('ReactDOMServer', () => {
527 expectDev(console.error.calls.mostRecent().args[0]).toBe(
528 'Warning: forceUpdate(...): Can only update a mounting component. ' +
529 'This usually means you called forceUpdate() outside componentWillMount() on the server. ' +
530 - 'This is a no-op. Please check the code for the Baz component.'
530 + 'This is a no-op.\n\nPlease check the code for the Baz component.'
531 );
532 var markup = ReactDOMServer.renderToStaticMarkup(<Baz />);
533 expect(markup).toBe('<div></div>');
src/renderers/dom/shared/__tests__/findDOMNode-test.js
+1 -1
@@ -64,7 +64,7 @@ describe('findDOMNode', () => {
64 expect(function() {
65 ReactDOM.findDOMNode({foo: 'bar'});
66 }).toThrowError(
67 - 'Element appears to be neither ReactComponent nor DOMNode (keys: foo)'
67 + 'Element appears to be neither ReactComponent nor DOMNode. Keys: foo'
68 );
69 });
70
src/renderers/dom/shared/findDOMNode.js
+1 -1
@@ -64,7 +64,7 @@ const findDOMNode = function(componentOrElement : Element | ?ReactComponent<any,
64 } else {
65 invariant(
66 false,
67 - 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)',
67 + 'Element appears to be neither ReactComponent nor DOMNode. Keys: %s',
68 Object.keys(componentOrElement)
69 );
70 }
src/renderers/dom/shared/utils/ReactControlledValuePropTypes.js
+1 -1
@@ -61,7 +61,7 @@ var propTypes = {
61 var loggedTypeFailures = {};
62 function getDeclarationErrorAddendum(ownerName) {
63 if (ownerName) {
64 - return ' Check the render method of `' + ownerName + '`.';
64 + return '\n\nCheck the render method of `' + ownerName + '`.';
65 }
66 return '';
67 }
src/renderers/dom/stack/client/ReactDOMComponent.js
+1 -1
@@ -66,7 +66,7 @@ function getDeclarationErrorAddendum(internalInstance) {
66 if (owner) {
67 var name = owner.getName();
68 if (name) {
69 - return ' This DOM node was rendered by `' + name + '`.';
69 + return '\n\nThis DOM node was rendered by `' + name + '`.';
70 }
71 }
72 }
src/renderers/dom/stack/client/ReactMount.js
+2 -2
@@ -369,7 +369,7 @@ var ReactMount = {
369 '_renderNewRootComponent(): Render methods should be a pure function ' +
370 'of props and state; triggering nested component updates from ' +
371 'render is not allowed. If necessary, trigger nested updates in ' +
372 - 'componentDidUpdate. Check the render method of %s.',
372 + 'componentDidUpdate.\n\nCheck the render method of %s.',
373 ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
374 'ReactCompositeComponent'
375 );
@@ -572,7 +572,7 @@ var ReactMount = {
572 'unmountComponentAtNode(): Render methods should be a pure function ' +
573 'of props and state; triggering nested component updates from render ' +
574 'is not allowed. If necessary, trigger nested updates in ' +
575 - 'componentDidUpdate. Check the render method of %s.',
575 + 'componentDidUpdate.\n\nCheck the render method of %s.',
576 ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
577 'ReactCompositeComponent'
578 );
src/renderers/dom/stack/client/wrappers/ReactDOMSelect.js
+1 -1
@@ -22,7 +22,7 @@ function getDeclarationErrorAddendum(owner) {
22 if (owner) {
23 var name = owner.getName();
24 if (name) {
25 - return ' Check the render method of `' + name + '`.';
25 + return '\n\nCheck the render method of `' + name + '`.';
26 }
27 }
28 return '';
src/renderers/dom/stack/server/ReactServerUpdateQueue.js
+1 -1
@@ -25,7 +25,7 @@ function warnNoop(publicInstance: ReactComponent<any, any, any>, callerName: str
25 false,
26 '%s(...): Can only update a mounting component. ' +
27 'This usually means you called %s() outside componentWillMount() on the server. ' +
28 - 'This is a no-op. Please check the code for the %s component.',
28 + 'This is a no-op.\n\nPlease check the code for the %s component.',
29 callerName,
30 callerName,
31 constructor && (constructor.displayName || constructor.name) || 'ReactClass'
src/renderers/shared/ReactDebugTool.js
+2 -2
@@ -174,8 +174,8 @@ if (__DEV__) {
174 if (currentTimerType && !lifeCycleTimerHasWarned) {
175 warning(
176 false,
177 - 'There is an internal error in the React performance measurement code. ' +
178 - 'Did not expect %s timer to start while %s timer is still in ' +
177 + 'There is an internal error in the React performance measurement code.' +
178 + '\n\nDid not expect %s timer to start while %s timer is still in ' +
179 'progress for %s instance.',
180 timerType,
181 currentTimerType || 'no',
src/renderers/shared/fiber/ReactFiber.js
+1 -1
@@ -372,7 +372,7 @@ function createFiberFromElementType(
372 }
373 const ownerName = debugOwner ? getComponentName(debugOwner) : null;
374 if (ownerName) {
375 - info += ' Check the render method of `' + ownerName + '`.';
375 + info += '\n\nCheck the render method of `' + ownerName + '`.';
376 }
377 }
378 invariant(
src/renderers/shared/fiber/ReactFiberBeginWork.js
+1 -1
@@ -478,7 +478,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
478 let info = '';
479 const ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName();
480 if (ownerName) {
481 - info += ' Check the render method of `' + ownerName + '`.';
481 + info += '\n\nCheck the render method of `' + ownerName + '`.';
482 }
483
484 let warningKey = ownerName || workInProgress._debugID || '';
src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js
+2 -2
@@ -757,7 +757,7 @@ describe('ReactIncrementalErrorHandling', () => {
757 'Element type is invalid: expected a string (for built-in components) or ' +
758 'a class/function (for composite components) but got: undefined. ' +
759 'You likely forgot to export your component from the file it\'s ' +
760 - 'defined in. Check the render method of `BrokenRender`.'
760 + 'defined in.\n\nCheck the render method of `BrokenRender`.'
761 )]);
762 expect(console.error.calls.count()).toBe(1);
763 });
@@ -800,7 +800,7 @@ describe('ReactIncrementalErrorHandling', () => {
800 'Element type is invalid: expected a string (for built-in components) or ' +
801 'a class/function (for composite components) but got: undefined. ' +
802 'You likely forgot to export your component from the file it\'s ' +
803 - 'defined in. Check the render method of `BrokenRender`.'
803 + 'defined in.\n\nCheck the render method of `BrokenRender`.'
804 )]);
805 expect(console.error.calls.count()).toBe(1);
806 });
src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
+1 -1
@@ -1138,7 +1138,7 @@ describe('ReactIncrementalSideEffects', () => {
1138
1139 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
1140 'Warning: Stateless function components cannot be given refs. ' +
1141 - 'Attempts to access this ref will fail. Check the render method ' +
1141 + 'Attempts to access this ref will fail.\n\nCheck the render method ' +
1142 'of `Foo`.\n' +
1143 ' in FunctionalComponent (at **)\n' +
1144 ' in div (at **)\n' +
src/renderers/shared/shared/__tests__/ReactComponent-test.js
+1 -1
@@ -370,7 +370,7 @@ describe('ReactComponent', () => {
370 'Element type is invalid: expected a string (for built-in components) ' +
371 'or a class/function (for composite components) but got: undefined. ' +
372 'You likely forgot to export your component from the file it\'s ' +
373 - 'defined in. Check the render method of `Bar`.'
373 + 'defined in.\n\nCheck the render method of `Bar`.'
374 );
375
376 // One warning for each element creation
src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js
+1 -1
@@ -237,7 +237,7 @@ describe('ReactComponentLifeCycle', () => {
237 expectDev(console.error.calls.argsFor(0)[0]).toBe(
238 'Warning: setState(...): Can only update a mounted or ' +
239 'mounting component. This usually means you called setState() on an ' +
240 - 'unmounted component. This is a no-op. Please check the code for the ' +
240 + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' +
241 'StatefulComponent component.'
242 );
243 });
src/renderers/shared/shared/__tests__/ReactCompositeComponent-test.js
+3 -3
@@ -280,7 +280,7 @@ describe('ReactCompositeComponent', () => {
280 expectDev(console.error.calls.argsFor(0)[0]).toBe(
281 'Warning: forceUpdate(...): Can only update a mounted or ' +
282 'mounting component. This usually means you called forceUpdate() on an ' +
283 - 'unmounted component. This is a no-op. Please check the code for the ' +
283 + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' +
284 'Component component.'
285 );
286 });
@@ -324,7 +324,7 @@ describe('ReactCompositeComponent', () => {
324 expectDev(console.error.calls.argsFor(0)[0]).toBe(
325 'Warning: setState(...): Can only update a mounted or ' +
326 'mounting component. This usually means you called setState() on an ' +
327 - 'unmounted component. This is a no-op. Please check the code for the ' +
327 + 'unmounted component. This is a no-op.\n\nPlease check the code for the ' +
328 'Component component.'
329 );
330 });
@@ -1033,7 +1033,7 @@ describe('ReactCompositeComponent', () => {
1033 'Warning: _renderNewRootComponent(): Render methods should ' +
1034 'be a pure function of props and state; triggering nested component ' +
1035 'updates from render is not allowed. If necessary, trigger nested ' +
1036 - 'updates in componentDidUpdate. Check the render method of Outer.'
1036 + 'updates in componentDidUpdate.\n\nCheck the render method of Outer.'
1037 );
1038 });
1039
src/renderers/shared/shared/__tests__/ReactMultiChild-test.js
+1 -1
@@ -280,7 +280,7 @@ describe('ReactMultiChild', () => {
280 expectDev(console.error.calls.argsFor(0)[0]).toBe(
281 'Warning: Using Maps as children is not yet fully supported. It is an ' +
282 'experimental feature that might be removed. Convert it to a sequence ' +
283 - '/ iterable of keyed ReactElements instead. Check the render method of `Parent`.'
283 + '/ iterable of keyed ReactElements instead.\n\nCheck the render method of `Parent`.'
284 );
285 });
286 });
src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js
+2 -2
@@ -190,7 +190,7 @@ describe('ReactStatelessComponent', () => {
190 expectDev(console.error.calls.count()).toBe(1);
191 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
192 'Warning: Stateless function components cannot be given refs. ' +
193 - 'Attempts to access this ref will fail. Check the render method ' +
193 + 'Attempts to access this ref will fail.\n\nCheck the render method ' +
194 'of `ParentUsingStringRef`.\n' +
195 ' in StatelessComponent (at **)\n' +
196 ' in div (at **)\n' +
@@ -225,7 +225,7 @@ describe('ReactStatelessComponent', () => {
225 expectDev(console.error.calls.count()).toBe(1);
226 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
227 'Warning: Stateless function components cannot be given refs. ' +
228 - 'Attempts to access this ref will fail. Check the render method ' +
228 + 'Attempts to access this ref will fail.\n\nCheck the render method ' +
229 'of `ParentUsingFunctionRef`.\n' +
230 ' in StatelessComponent (at **)\n' +
231 ' in div (at **)\n' +
src/renderers/shared/stack/reconciler/ReactRef.js
+1 -1
@@ -37,7 +37,7 @@ function attachRef(ref, component, owner) {
37 ownerName = owner.getName();
38 }
39 if (ownerName) {
40 - info += ' Check the render method of `' + ownerName + '`.';
40 + info += '\n\nCheck the render method of `' + ownerName + '`.';
41 }
42 }
43
src/renderers/shared/stack/reconciler/ReactUpdateQueue.js
+1 -1
@@ -35,7 +35,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
35 !callerName,
36 '%s(...): Can only update a mounted or mounting component. ' +
37 'This usually means you called %s() on an unmounted component. ' +
38 - 'This is a no-op. Please check the code for the %s component.',
38 + 'This is a no-op.\n\nPlease check the code for the %s component.',
39 callerName,
40 callerName,
41 ctor && (ctor.displayName || ctor.name) || 'ReactClass'
src/renderers/shared/stack/reconciler/instantiateReactComponent.js
+1 -1
@@ -35,7 +35,7 @@ function getDeclarationErrorAddendum(owner) {
35 if (owner) {
36 var name = owner.getName();
37 if (name) {
38 - return ' Check the render method of `' + name + '`.';
38 + return '\n\nCheck the render method of `' + name + '`.';
39 }
40 }
41 return '';
src/renderers/testing/__tests__/ReactTestRenderer-test.js
+1 -1
@@ -268,7 +268,7 @@ describe('ReactTestRenderer', () => {
268 expectDev(console.error.calls.count()).toBe(1);
269 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
270 'Warning: Stateless function components cannot be given refs. Attempts ' +
271 - 'to access this ref will fail. Check the render method of `Foo`.\n' +
271 + 'to access this ref will fail.\n\nCheck the render method of `Foo`.\n' +
272 ' in Bar (at **)\n' +
273 ' in Foo (at **)'
274 );
src/shared/utils/traverseAllChildren.js
+2 -2
@@ -129,7 +129,7 @@ function traverseAllChildrenImpl(
129 if (ReactCurrentOwner.current) {
130 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
131 if (mapsAsChildrenOwnerName) {
132 - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
132 + mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
133 }
134 }
135 warning(
@@ -175,7 +175,7 @@ function traverseAllChildrenImpl(
175 if (ReactCurrentOwner.current) {
176 var name = ReactCurrentOwner.current.getName();
177 if (name) {
178 - addendum += ' Check the render method of `' + name + '`.';
178 + addendum += '\n\nCheck the render method of `' + name + '`.';
179 }
180 }
181 }