UNPKG

701 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = deprecatedPropType;
7
8function deprecatedPropType(validator, reason) {
9 if (process.env.NODE_ENV === 'production') {
10 return function () {
11 return null;
12 };
13 }
14
15 return function (props, propName, componentName, location, propFullName) {
16 var componentNameSafe = componentName || '<<anonymous>>';
17 var propFullNameSafe = propFullName || propName;
18
19 if (typeof props[propName] !== 'undefined') {
20 return new Error("The ".concat(location, " `").concat(propFullNameSafe, "` of ") + "`".concat(componentNameSafe, "` is deprecated. ").concat(reason));
21 }
22
23 return null;
24 };
25}
\No newline at end of file