反应组件道具包裹在大括号内?



我有一个组件定义为:

type myType = anotherType<weirdType1, weirdType2, weirdType3>;
function weirdComponent({q}: myType)

它被称为:<weirdComponent {...myVar} />,其中myVarmyType的实例。

  • 怪异组件函数签名中的{q}是什么意思

  • {...myVar}做什么?

  • myType什么样的类型?

{q} 在 weird组件函数签名中是什么意思

它的论点解构。

什么是{...myVar} do?

其传播属性

myType 是什么类型?

它的anotherType<weirdType1, weirdType2, weirdType3>;.您可以将鼠标悬停在其上以查看详细信息。

最新更新