I have an object which contains a reference to a FunctionalComponent however when I pass that reference into the createElement statement it is throwing a TS error.
Question: why is this complaining? my interface excepts both Component and FunctionalComponent.
Example:
const someFunctionalComponent: React.FC = () => {
return <div></div>
}
const anotherFunctionalComponent: React.FC = () => {
return <div></div>
}
const somePages = [someFunctionalComponent, anotherFunctionalComponent];
interface TabPage {
active: number;
content: React.Component | React.FC;
}
somePages.forEach(page => React.createElement(page))
