react router install
npm install react-router-dom
import React from "react";
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
export default function App() {
return (
<Router>
<div>
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">About</Link>
</li>
<li>
<Link to="/users">Users</Link>
</li>
</ul>
</nav>
{/* A <Switch> looks through its children <Route>s and
renders the first one that matches the current URL. */}
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/users">
<Users />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
</div>
</Router>
);
}
function Home() {
return <h2>Home</h2>;
}
function About() {
return <h2>About</h2>;
}
function Users() {
return <h2>Users</h2>;
}
npm install react-router-domnpm install --save react-router-dom// How to work with react router dom in react-web
import {
BrowserRouter as Router,
StaticRouter, // for server rendering
Route,
Link
// etc.
} from "react-router-dom";npm install --save react-router-dom
Also in C++:
- Title
- how to stop mongodb server in ubuntu
- Category
- C++
- Title
- install composer ubuntu 18.04
- Category
- C++
- Title
- debian install node js
- Category
- C++
- Title
- git log with numbers
- Category
- C++
- Title
- dependency problems - leaving unconfigured Errors were encountered while processing:
- Category
- C++
- Title
- error gyp ERR! stack Error: not found: make
- Category
- C++
- Title
- check all ruby version ubuntu
- Category
- C++
- Title
- Can't resolve 'autosuggest-highlight/parse
- Category
- C++
- Title
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Category
- C++
- Title
- alpine install psql
- Category
- C++
- Title
- install composer
- Category
- C++
- Title
- linux nano editor
- Category
- C++
- Title
- how to install bully on ubuntu 20.04
- Category
- C++
- Title
- react-native 6 digit code
- Category
- C++
- Title
- history command linux
- Category
- C++
- Title
- curl multiple requests
- Category
- C++
- Title
- apt-get install language-pack-utf-8
- Category
- C++
- Title
- restart computer command linux
- Category
- C++
- Title
- how to get rid of the start up screen on your pyinstaller .exe file
- Category
- C++
- Title
- keeping unity project on github
- Category
- C++
- Title
- django gitignore
- Category
- C++
- Title
- grep all except last
- Category
- C++
- Title
- mui treasury styles install
- Category
- C++
- Title
- ubuntu connect to postgres
- Category
- C++