Created
June 15, 2021 14:44
-
-
Save marshallmurphy/8e0b287f2f41f27153ea7f9784f581e1 to your computer and use it in GitHub Desktop.
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
const removeTodo = (i, checked) => { | |
if (checked) { | |
const newCompletedTodos = [...completedTodos]; | |
newCompletedTodos.splice(i, 1); | |
setCompletedTodos(newCompletedTodos); | |
} else { | |
const newTodos = [...todos]; | |
newTodos.splice(i, 1); | |
setTodos(newTodos); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment