1
我有以下代碼:陣營材料的UI菜單項containerElement不工作
<MenuItem primaryText="home" containerElement={<Link to="/" />} />
但它不能在其他主題/線程菜單項地方像這裏Material UI Menu using routes討論的解釋工作。 一旦我添加containerElement道具菜單項我得到這個異常:
Uncaught Error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
You likely forgot to export your component from the file it's defined in.
Check the render method of `EnhancedButton`.
你如何導入你的'鏈接'? – Andrew
這是進口 '從'react-router'導入鏈接;' – comprex
不確定是主要問題,但應該從'react-router'導入{鏈接};' – Andrew