带/不带typeof
前接口有什么区别?
它会改变行为吗?我找不到这方面的医生。
interface Props {
children: React.ReactNode;
}
type Item = React.FC<Props>;
type Component = React.FC & {
Item: typeof Item;
}
interface Props {
children: React.ReactNode;
}
type Item = React.FC<Props>;
type Component = React.FC & {
Item: Item;
}
第一个没有意义,因为typeof
只能应用于值,而不能应用于类型。