Created
May 13, 2021 03:39
-
-
Save achukka/81ae173cb322fb4ab0105c579fef2549 to your computer and use it in GitHub Desktop.
Gist for App in ToDoList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ToDoList, { Item } from "./ToDoList"; | |
const initialList = [ | |
{ | |
task: "Pick up Milk", | |
priority: 1, | |
}, | |
{ | |
task: "Buy Eggs", | |
priority: 2, | |
}, | |
{ | |
task: "Buy Bread", | |
priority: 3, | |
}, | |
]; | |
class App extends React.Component<{}, { items: Item[] }> { | |
constructor(props: any) { | |
super(props); | |
this.state = { | |
items: initialList, | |
}; | |
} | |
render() { | |
const { items } = this.state; | |
return ( | |
<div className="App"> | |
<br /> | |
<ToDoList items={items} /> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment