-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOldApp
More file actions
63 lines (49 loc) · 1.4 KB
/
OldApp
File metadata and controls
63 lines (49 loc) · 1.4 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React, { useState } from 'react';
// import logo from './logo.svg';
import './App.css';
import Form from './Components/Form';
import List from './Components/List';
import TodoPage from './Pages/TodoPage'
import {
BrowserRouter,
Routes,
Route,
} from "react-router-dom";
// import Todo from './Components/Todo';
export interface IState{
people: {
name: string
age: number
url: string
note?: string
}[]
}
function App() {
// const [number, setNumber] = useState<number | string | boolean>(6)
const [person, setPerson] = useState<IState["people"]>([
{
name: "LeBron James",
age: 20,
url: "https://cdn.nba.com/headshots/nba/latest/1040x760/2544.png",
note: "Allergic to staying on the same team"
}
])
// we dont define complicated states inside tha ankle brackets, we do it using the interfaces...
// const [person, setPerson] = useState<{age: number, name: string}[]>([])
return (
<BrowserRouter>
<Routes>
{/* <Route path="/" element={
<div className="App">
<h2>People Invited to my party</h2>
<List people={person}/>
<Form people={person} setPeople={setPerson}/>
</div>
} /> */}
{/* SECOND ROUTE */}
{/* <Route path="/todo" element={<TodoPage />}/> */}
</Routes>
</BrowserRouter>
);
}
export default App;