UNPKG

@mui/utils

Version:
19 lines (18 loc) 635 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = deprecatedPropType; function deprecatedPropType(validator, reason) { if (process.env.NODE_ENV === 'production') { return () => null; } return (props, propName, componentName, location, propFullName) => { const componentNameSafe = componentName || '<<anonymous>>'; const propFullNameSafe = propFullName || propName; if (typeof props[propName] !== 'undefined') { return new Error(`The ${location} \`${propFullNameSafe}\` of ` + `\`${componentNameSafe}\` is deprecated. ${reason}`); } return null; }; }