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
2 changes: 1 addition & 1 deletion src/addons/__tests__/ReactFragment-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.'
);
});

Expand Down
4 changes: 2 additions & 2 deletions src/isomorphic/classic/class/ReactClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,15 @@ 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) {
warning(
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;
Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/classic/class/__tests__/ReactBind-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
});

Expand Down
6 changes: 3 additions & 3 deletions src/isomorphic/classic/element/ReactElementValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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 '';
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
);
});
Expand Down Expand Up @@ -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 <div>. See ' +
'"key" prop.\n\nCheck the top-level render call using <div>. See ' +
'https://fb.me/react-warning-keys for more information.\n' +
' in div (at **)'
);
Expand Down Expand Up @@ -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' +
Expand Down Expand Up @@ -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'
);
});
Expand Down Expand Up @@ -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 **.'
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/modern/class/ReactNoopUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
);
});
Expand Down Expand Up @@ -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 <Div />;
expectDev(console.error.calls.count()).toBe(4);
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/fiber/ReactDOMFiberComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/shared/CSSPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
};
Expand Down
28 changes: 14 additions & 14 deletions src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ describe('CSSPropertyOperations', () => {
ReactDOM.render(<Comp />, 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`.'
);
});

Expand All @@ -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`.'
);
});

Expand All @@ -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`.'
);
});

Expand All @@ -202,12 +202,12 @@ describe('CSSPropertyOperations', () => {
ReactDOM.render(<Comp />, 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.',
);
});

Expand All @@ -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`.'
);
});
});
6 changes: 3 additions & 3 deletions src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ describe('ReactDOMComponent', () => {
container
);
}).toThrowError(
'This DOM node was rendered by `Owner`.'
'\n\nThis DOM node was rendered by `Owner`.'
);
});

Expand Down Expand Up @@ -1088,7 +1088,7 @@ describe('ReactDOMComponent', () => {
ReactDOM.render(<X />, 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`.'
);
});

Expand Down Expand Up @@ -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`.'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Foo />);
expect(markup).toBe('<div>hello</div>');
Expand All @@ -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(<Bar />);
expect(markup).toBe('<div>hello</div>');
Expand All @@ -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(<Baz />);
expect(markup).toBe('<div></div>');
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/shared/__tests__/findDOMNode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/shared/findDOMNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const findDOMNode = function(componentOrElement : Element | ?ReactComponent<any,
} else {
invariant(
false,
'Element appears to be neither ReactComponent nor DOMNode (keys: %s)',
'Element appears to be neither ReactComponent nor DOMNode. Keys: %s',
Object.keys(componentOrElement)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var propTypes = {
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(ownerName) {
if (ownerName) {
return ' Check the render method of `' + ownerName + '`.';
return '\n\nCheck the render method of `' + ownerName + '`.';
}
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/stack/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function getDeclarationErrorAddendum(internalInstance) {
if (owner) {
var name = owner.getName();
if (name) {
return ' This DOM node was rendered by `' + name + '`.';
return '\n\nThis DOM node was rendered by `' + name + '`.';
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/dom/stack/client/ReactMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ var ReactMount = {
'_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 %s.',
'componentDidUpdate.\n\nCheck the render method of %s.',
ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
'ReactCompositeComponent'
);
Expand Down Expand Up @@ -572,7 +572,7 @@ var ReactMount = {
'unmountComponentAtNode(): 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 %s.',
'componentDidUpdate.\n\nCheck the render method of %s.',
ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
'ReactCompositeComponent'
);
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/stack/client/wrappers/ReactDOMSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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 '';
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/stack/server/ReactServerUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function warnNoop(publicInstance: ReactComponent<any, any, any>, 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'
Expand Down
Loading