propType for accepting a component as a prop?
This seems to be most up to date: https://stackoverflow.com/a/55784547/4993912
TLDR;
const propTypes = {
component: PropTypes.elementType,
requiredComponent: PropTypes.elementType.isRequired,
};
I crossposted to github and got this answer. So it should be:
const componentType = PropTypes.oneOfType([PropTypes.string, PropTypes.func])
func
covers types from "classic" react components, ES6 classes, and stateless function components. string
covers the native element case (eg "div").