import {Routes} from "react-router-dom"
<Routes>
<Route path="/" element = {<Home/>} />
<Route path="/List" element = {<List/>} />
<Routes/>
Warning: 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.
react-router-dom版本6写法:在外层嵌套一个routes就好了Warning: 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.也可以把版本改为5...