I don't understand why it gives me this error when , is this because i am using react router v6. Can someone look at this and tell if i missing something. Here is the code :
Code :
import { useParams, useMatch, Route, Routes, BrowserRouter as Router } from 'react-router-dom';
const {id} = useParams();
const [book, setBook] = useState(null);
const match = useMatch();
<Router>
<Routes>
<Route path={`${match.path}/`}>
<h4>{book && book.title}</h4>
</Route>
</Routes>
</Router>
