index.js
1.32 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import reportWebVitals from "./reportWebVitals";
import App from "./App";
// routes
import Signup from "./routes/signup";
import Login from "./routes/login";
import Users from "./routes/users";
import Settings from "./routes/settings";
import Tweet from "./routes/tweet";
import NotFound from "./routes/notfound";
// styles
import "./styles/layout.scss";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<div className="container">
<BrowserRouter>
<Routes>
<Route exact path="/" element={<App />} />
<Route exact path="/login" element={<Login />} />
<Route exact path="/signup" element={<Signup />} />
<Route exact path="/users" element={<Users />} />
<Route exact path="/settings" element={<Settings />} />
<Route exact path="/tell" element={<Tweet />} />
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
</div>
);
// path="/" is for Weather(main) page
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();