From a86d25d584d085aef7d70bec2779accd12fd7db9 Mon Sep 17 00:00:00 2001 From: chico Date: Thu, 5 Nov 2015 05:45:34 +0300 Subject: [PATCH] update error messages --- src/isomorphic/classic/types/ReactPropTypes.js | 4 ++-- src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/isomorphic/classic/types/ReactPropTypes.js b/src/isomorphic/classic/types/ReactPropTypes.js index 4016a206bc..02a8c86ec3 100644 --- a/src/isomorphic/classic/types/ReactPropTypes.js +++ b/src/isomorphic/classic/types/ReactPropTypes.js @@ -146,7 +146,7 @@ function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error( - `Invalid argument \`${propFullName}\` supplied to \`${componentName}\`, expected valid PropType.` + `Property \`${propFullName}\` of component \`${componentName}\` has invalid PropType notation inside arrayOf.` ); } var propValue = props[propName]; @@ -237,7 +237,7 @@ function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error( - `Invalid argument \`${propFullName}\` supplied to \`${componentName}\`, expected valid PropType.` + `Property \`${propFullName}\` of component \`${componentName}\` has invalid PropType notation inside objectOf.` ); } var propValue = props[propName]; diff --git a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js index 1b6512c168..e626f99131 100644 --- a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js +++ b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js @@ -142,7 +142,7 @@ describe('ReactPropTypes', function() { typeCheckFail( PropTypes.arrayOf({ foo: PropTypes.string }), { foo: 'bar' }, - 'Invalid argument `testProp` supplied to `testComponent`, expected valid PropType.' + 'Property `testProp` of component `testComponent` has invalid PropType notation inside arrayOf.' ); }); @@ -473,7 +473,7 @@ describe('ReactPropTypes', function() { typeCheckFail( PropTypes.objectOf({ foo: PropTypes.string }), { foo: 'bar' }, - 'Invalid argument `testProp` supplied to `testComponent`, expected valid PropType.' + 'Property `testProp` of component `testComponent` has invalid PropType notation inside objectOf.' ); });