forked from btholt/complete-intro-to-react-v5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
26 lines (24 loc) · 672 Bytes
/
App.js
File metadata and controls
26 lines (24 loc) · 672 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
import React, { useState } from "react";
import ReactDOM from "react-dom";
import { Router, Link } from "@reach/router";
import Details from "./Details";
import SearchParams from "./SearchParams";
import ThemeContext from "./ThemeContext";
const App = () => {
const theme = useState("darkblue");
return (
<ThemeContext.Provider value={theme}>
<div>
<header>
<Link to="/">Adopt Me!</Link>
</header>
;
<Router>
<SearchParams path="/" />
<Details path="/details/:id" />
</Router>
</div>
</ThemeContext.Provider>
);
};
ReactDOM.render(<App />, document.getElementById("root"));