Reactjs React和TypeScript-组件<;道具及;{}>;
这段代码是什么意思Reactjs React和TypeScript-组件<;道具及;{}>;,reactjs,typescript,Reactjs,Typescript,这段代码是什么意思 export class App extends Component<Props & { some: string; some2: string; }> 这是一种交叉类型。在typescript中定义接口时,可以用分号分隔每个属性。也可以使用逗号。没关系 这是一种交叉路口类型。在typescript中定义接口时,可以用分号分隔每个属性。也可以使用逗号。没关系 导出类应用程序扩展组件 这和 interface SomeInterface { so
export class App extends Component<Props & { some: string; some2: string; }>
这是一种交叉类型。在typescript中定义接口时,可以用分号分隔每个属性。也可以使用逗号。没关系
这是一种交叉路口类型。在typescript中定义接口时,可以用分号分隔每个属性。也可以使用逗号。没关系
导出类应用程序扩展组件
这和
interface SomeInterface {
some: string;
some2: string;
}
export class App extends Component<Props & SomeInterface>
interface-SomeInterface{
一些:弦;
第二部分:弦;
}
导出类应用程序扩展组件
它只是内联编写,而不是为这一行创建新接口。导出类应用程序扩展组件
这和
interface SomeInterface {
some: string;
some2: string;
}
export class App extends Component<Props & SomeInterface>
interface-SomeInterface{
一些:弦;
第二部分:弦;
}
导出类应用程序扩展组件
它只是内联编写,而不是为那一行创建新接口。它是一种内联类型,键
some
和some2
作为字符串。但是为什么会有“;”符号呢?为什么不“,”呢?这不是接口的一部分?它是一种内联类型,键some
和some2
作为字符串。但是为什么会有“;”符号呢?为什么不“,”呢?这不是接口的一部分吗?
interface SomeInterface {
some: string;
some2: string;
}
export class App extends Component<Props & SomeInterface>