Although React.ComponentProps<MyComponent> is quite handy, I'm unable to figure out how to use it to construct a type of MyComponent's props, when MyComponent contains type parameters, eg (shortened type taken from a module)
declare type TMyComponent = <T = unknown>(props: {foo: string, bar: T}) => ReactElement
Somehow, using TMyComponent, I'd like to construct the type, eg, {foo: string, bar: number}
Although the following doesn't accomplish what I'm trying to do, I hope it demonstrates what I'm trying to do,
type MyDesiredType = React.ComponentProps<TMyComponent<number>>
How can I construct a type from a component's props that accepts type parameters?