react路由报错
react路由报错:A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>

解决方法:
在index.js文件中,用<Routes>包围 <Route>
修改:
<Route path='/about' component={<About/>} />
为,
<Route path='/about' element={<About/>}
就这样式的,
import {Route, Routes, HashRouter} from 'react-router-dom'
<Routes>
<Route path='/about' element={<About/>} />
</Routes>