1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function requirePropFactory(componentNameInError) {
|
9 | if (process.env.NODE_ENV === 'production') {
|
10 | return function () {
|
11 | return null;
|
12 | };
|
13 | }
|
14 |
|
15 | var requireProp = function requireProp(requiredProp) {
|
16 | return function (props, propName, componentName, location, propFullName) {
|
17 | var propFullNameSafe = propFullName || propName;
|
18 |
|
19 | if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
|
20 | return new Error("The prop `".concat(propFullNameSafe, "` of ") + "`".concat(componentNameInError, "` must be used on `").concat(requiredProp, "`."));
|
21 | }
|
22 |
|
23 | return null;
|
24 | };
|
25 | };
|
26 |
|
27 | return requireProp;
|
28 | }
|
29 |
|
30 | var _default = requirePropFactory;
|
31 | exports.default = _default; |
\ | No newline at end of file |