React Hooks + Spring Boot CRUD Full Stack App - 10 - Configure Routing in React App

preview_player
Показать описание
In this video, you will learn how to configure Routing in React application.

#react #springboot #fullstack

Рекомендации по теме
Комментарии
Автор

Got an error: Attempted import error: 'Switch' is not exported from 'react-router-dom' (imported as 'Switch').
Seems that react-router-dom v6+ will cause this.
Changed code to:
...

import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';

....

<Router>
<HeaderComponent/>
<div className="container">
<Routes>
<Route exact path="/"
<Route path="/spells"
</Routes>
</div>
<FooterComponent/>
</Router>

....

And now it saves and page works as expected for both paths.

leojboby
welcome to shbcf.ru