我正在尝试理解如何(如果可能的话)从给定组件中提取props类型。
const Component = (props: { color: string }) => <div {...props} />;
type ComponentProps = $ExtractArguments<typeof Component>[0] // pseudo-code我发现这个工具在谷歌上搜索,但我不知道它是否有用...
type $Arguments<F> = $Call<<A: $ReadOnlyArray<mixed>>((...A) => mixed) => A, F>;https://stackoverflow.com/questions/58609793
复制相似问题