Browse Source

Do not use ReactPropTypesLocationNames.

pull/1/head
Titouan Rigoudy 9 years ago
parent
commit
11b54d6b4b
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      src/utils/propTypeRequiredWrapper.js

+ 2
- 5
src/utils/propTypeRequiredWrapper.js View File

@ -1,16 +1,13 @@
const checkRequiredThenValidate = (validator) =>
(props, propName, componentName, location) =>
{
if (props[propName] !== null) {
if (props[propName] != null) {
return validator(props, propName, componentName, location);
}
/* global ReactPropTypesLocationNames */ // Pacify ESLint
const location_name = ReactPropTypesLocationNames[location];
return new Error(
`Required prop \`${propName}\` was not specified in ` +
`\`${componentName}\`. Check the render method of \`${location_name}\`.`
`\`${componentName}\`.`
);
};


Loading…
Cancel
Save