Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
如下源碼導(dǎo)致報(bào)錯(cuò)
<Route path="/demo" element={Demo} />
原因:element 的值是組件 注意格式
修復(fù)如下:
<Route path="/demo" element={<Demo />} />