This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Route path='*' element={<NotFound />} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Route path='/blog/:topicId' element={<Blog />} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Link to="/blog/detail" state={{ from: "category"}}> Next Step </Link> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav> | |
<Link to="/">Home</Link> | |
<Link to='/about'>About</Link> | |
<Link to="/blog">Blog</Link> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Header from './components/common/Header'; | |
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; | |
import Home from './components/pages/Home'; | |
import About from './components/pages/About'; | |
import Blog from './components/pages/Blog'; | |
function App() { | |
return ( | |
<Router> | |
<Header /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Route path='/dashboard' element={<About />} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { BrowserRouter } from 'react-router-dom'; | |
ReactDOM.render( | |
<BrowserRouter> | |
<App /> | |
<BrowserRouter>, | |
document.getElementById('root') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//installing with npm | |
npm i react-router-dom | |
//installing with yarn | |
yarn add react-router-dom |