2017-09-26 94 views
0

我應該在下面的例子中爲我的IntelliJ Webstorm IDE添加JSDoc @param塊來停止拋出錯誤:Argument Type ComponentClass<undefined>不能分配給參數類型? ...'?JSDoc:如何爲React元素設置@param作爲函數參數?

/** 
* Renders the passed component into a div 
* @param { ??? } component // Question: <<< 
*/ 
const myRenderFunc = (component) => (
    <div>{component}</div> 
) 
+1

我想''''''應該使用,如果你不打算創建自己的typedef –

+0

感謝希望的是內置集成,但現在這樣做。 –

回答

0

你的陣營組件@param類型應該是{ReactElement}

相關問題