doc: add React Router to the entire application
This commit is contained in:
1 parent
1258f03a46
commit
83b2b70214
1 file changed
+11
-4
+11
-4
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user