前言:今天看到了这种代码:
export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;
有些不解中间的 &,看了文档知道了,其实是相当于把两个type融合在一起创造了一个新type,具体可以看这篇文章:TypeScript Intersection Types
export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;
有些不解中间的 &,看了文档知道了,其实是相当于把两个type融合在一起创造了一个新type,具体可以看这篇文章:TypeScript Intersection Types