From ebf0a9bbd90a8c5b27c3132d9ba7e525d59ab2fd Mon Sep 17 00:00:00 2001 From: arshiam2 Date: Wed, 3 Oct 2018 12:10:51 -0500 Subject: [PATCH] init --- src/App.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 8af6dd8..41db2de 100644 --- a/src/App.js +++ b/src/App.js @@ -14,7 +14,10 @@ class App extends Component { }; handleDelete = event => { - console.log("DELETE"); + var newTodoList = [...this.state.todos]; + var index = newTodoList.indexOf(event.target.value); + newTodoList.splice(index, 1); + this.setState({todos: newTodoList}); }; handleChange = event => { @@ -37,7 +40,7 @@ class App extends Component {
  • {todo + " "} - +
  • ))}