diff --git a/src/classic/element/ReactElementValidator.js b/src/classic/element/ReactElementValidator.js index 71a339313f..2d8f841171 100644 --- a/src/classic/element/ReactElementValidator.js +++ b/src/classic/element/ReactElementValidator.js @@ -249,8 +249,8 @@ function checkPropTypes(componentName, propTypes, props, location) { } warning( !error || error instanceof Error, - '%s: the type of %s `%s` is invalid; the type checker function ' + - 'must return `null` or an `Error`, but returned a %s. ' + + '%s: type specification of %s `%s` is invalid; the type checker ' + + 'function must return `null` or an `Error`, but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', diff --git a/src/classic/element/__tests__/ReactElementValidator-test.js b/src/classic/element/__tests__/ReactElementValidator-test.js index 757b29e73e..7c4a62e4ea 100644 --- a/src/classic/element/__tests__/ReactElementValidator-test.js +++ b/src/classic/element/__tests__/ReactElementValidator-test.js @@ -367,24 +367,24 @@ describe('ReactElementValidator', function() { var Component = React.createClass({ propTypes: { - prop: React.PropTypes.shape + myProp: React.PropTypes.shape }, render: function() { - return React.createElement('span', null, this.props.prop.value); + return React.createElement('span', null, this.props.myProp.value); } }); ReactTestUtils.renderIntoDocument( - React.createElement(Component, {prop: {value: 'hi'}}) + React.createElement(Component, {myProp: {value: 'hi'}}) ); expect(console.warn.calls.length).toBe(1); expect(console.warn.calls[0].args[0]).toBe( - 'Warning: Component: the type of prop `prop` is invalid; the type ' + - 'checker function must return `null` or an `Error`, but returned a ' + - 'function. You may have forgotten to pass an argument to the type ' + - 'checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, ' + - 'and shape all require an argument).' + 'Warning: Component: type specification of prop `myProp` is invalid; ' + + 'the type checker function must return `null` or an `Error`, but ' + + 'returned a function. You may have forgotten to pass an argument to ' + + 'the type checker creator (arrayOf, instanceOf, objectOf, oneOf, ' + + 'oneOfType, and shape all require an argument).' ); });