簡體   English   中英

包裹在大括號內的反應組件道具?

[英]React component props wrapped inside braces?

我有一個組件定義為:

type myType = anotherType<weirdType1, weirdType2, weirdType3>;

function weirdComponent({q}: myType)

它被稱為: <weirdComponent {...myVar} /> ,其中myVarmyType的一個實例。

  • 什么{q}在奇怪的組件 function 簽名中是什么意思

  • {...myVar}做什么?

  • myType是什么類型?

什么 {q} 在奇怪的組件 function 簽名中是什么意思

它的參數解構

{...myVar} 做什么?

傳播屬性

myType 是什么類型?

它的anotherType<weirdType1, weirdType2, weirdType3>; . 您可以通過 hover 查看詳細信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM