react项目中配置路由是出现以下报错
Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.
原因是老版本的react-router-dom,component的值,可以直接写,而新版的react-router-dom,elemen的值需要用</>包裹。
原代码
修改后