React Router
1. Introduction
Nhiệm vụ của React Router:
Tạo các trang / pages
URL Parameters
Auth
2. Các thành phần cơ bản
3 thành phần cần lưu ý
Routers : <BrowserRouter> and <HashRouter>, <Router>
Route matchers: <Route> and <Switch> đổi thành Routes v6
Navigation: <Link>, <NavLink> and <Redirect>

3. Hooks
use History

use Location
use Params
use Query
use RouteMatch
use Navigate


4. Example
5. Router with Auth
5.1 Auth with use context, use History
https://v5.reactrouter.com/web/example/auth-workflow
5.2 Router with Redux
Last updated
Was this helpful?