import React from 'react'
import {Redirect, Route, Routes} from "react-router-dom"
import App from "../pages/App"
import Book from "../pages/Book"
const AppRouter = () => {
return (
<div>
<Routes>
<Route path='/' exact={true} key={'/'} component={App}></Route>
<Route path='/book' exact={true} key={'/'} component={Book}></Route>
<Redirect to={'/'}></Redirect>
</Routes>
</div>
)
}
На данном примере кода не работают импорты.
Attempted import error: 'Redirect' is not exported from 'react-router-dom'.
То же самое и со switch.
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^6.0.1",
"react-router-dom": "^6.0.1",