doc: add React Router to the entire application

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