-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (25 loc) · 664 Bytes
/
index.js
File metadata and controls
27 lines (25 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from "react";
import { render } from "react-dom";
import { Nav, GlobalStyles } from "./src/components";
import { CountryList, CountryPage, Home } from "./src/pages";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
const App = () => (
<Router>
<div>
<GlobalStyles />
<Nav />
<Switch>
<Route path="/countries/:country">
<CountryPage />
</Route>
<Route path="/countries">
<CountryList />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
</div>
</Router>
);
render(<App />, document.getElementById("app"));