doc: add React Router to the entire application

This commit is contained in:
Leon Xu
2022-05-05 20:50:57 -07:00
parent 1258f03a46
commit 83b2b70214
+11 -4
View File
@@ -1,4 +1,5 @@
import React from "react";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
// Import file
import Header from "./Header/Header";
@@ -8,10 +9,16 @@ import "./App.css";
function App() {
return (
<section className="app">
<Header />
<Home />
</section>
<Router>
<section className="app">
<Switch>
<Route path="/">
<Header />
<Home />
</Route>
</Switch>
</section>
</Router>
);
}