mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
update error messages
This commit is contained in:
1 parent
7ae67916cc
commit
a86d25d584
2 files changed
+4
-4
No files matched your search
@@ -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];
|
||||
|
||||
@@ -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.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user