Given the following code using PropTypes (see this issue)
const SomeComponent = ({comp}) => {...}
SomeComponent.propTypes = {
comp: PropTypes.shape({
type: PropTypes.oneOf([SomeOtherComponent])
})
}
what is the equivalent using Flow types?
I've only gotten as far as:
const SomeComponent = ({comp}: {comp: React$Element<any>}) => {...}
using this for reference, but that will allow comp
to be any React component.
How do I type-check a prop to ensure it is an instance of a specific React component using Flow?