Closed thereis closed 1 year ago
Hello, is it possible to inherit the return type dynamically of a given property? For example, let's assume we have a React component:
type InputProps = { value: string } export const Input: FC<InputProps> = () => (<></>);
And then, we have the following type:
type FormField = { component: Component | ForwardRefExoticComponent<any> | any; props: ??? // it should get the return } const fields: FormField[] = [ { component: Input, props: { value: "test" } } ]
I've been trying this from the past few hours and couldn't achieve any valuable results.
Best.
This is not an issue with hotscript.
please seek help in typescript dedicated discords for typescript related help.
Hello, is it possible to inherit the return type dynamically of a given property? For example, let's assume we have a React component:
And then, we have the following type:
I've been trying this from the past few hours and couldn't achieve any valuable results.
Best.