Skip to content

Instantly share code, notes, and snippets.

@achukka
Created May 13, 2021 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achukka/81ae173cb322fb4ab0105c579fef2549 to your computer and use it in GitHub Desktop.
Save achukka/81ae173cb322fb4ab0105c579fef2549 to your computer and use it in GitHub Desktop.
Gist for App in ToDoList
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