ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
10 lines (8 loc) • 327 B
text/typescript
import { isValidElementType } from 'react-is';
export default (props, propName, componentName) => {
if (props[propName] && !isValidElementType(props[propName])) {
return new Error(
`Invalid prop '${propName}' supplied to '${componentName}': the prop is not a valid React component`
);
}
};