I have a Tabs component that looks like this:
const tabs = [{
component: Component1,
props: propsToComponent1
},
{
component: Component2,
props: propsToComponent2
}],
<Tabs tabs={tabs} />
I need to validate the props key so the props matches the props type of the component
I’ve tried doing something like this
interface iTab {
component: React.ComponentType<any>;
props?: iTab['component']['defaultProps'],
...
}
interface iTabsProps {
tabs?: Array<iTab>;
...
}
but its not working and I’m stuck here.