@mui/utils
Version:
Utility functions for React components.
20 lines (19 loc) • 596 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HTMLElementType;
function HTMLElementType(props, propName, componentName, location, propFullName) {
if (process.env.NODE_ENV === 'production') {
return null;
}
const propValue = props[propName];
const safePropName = propFullName || propName;
if (propValue == null) {
return null;
}
if (propValue && propValue.nodeType !== 1) {
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an HTMLElement.`);
}
return null;
}
;