diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-18 13:59:48 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-18 13:59:48 -0600 |
commit | 8e274132e60b21277506df3c7b47e5f75518fb32 (patch) | |
tree | f7cd47d25cd7071f4e56de61486d65690476ae2d /src/ToDo.jsx | |
parent | 8cb67965e363a9ea602a51d6bdee1c4d1e067c54 (diff) | |
download | ToDo-App-FE-8e274132e60b21277506df3c7b47e5f75518fb32.tar.gz ToDo-App-FE-8e274132e60b21277506df3c7b47e5f75518fb32.zip |
Added remove action.
Diffstat (limited to 'src/ToDo.jsx')
-rw-r--r-- | src/ToDo.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ToDo.jsx b/src/ToDo.jsx index 1dbfad7..3644db3 100644 --- a/src/ToDo.jsx +++ b/src/ToDo.jsx @@ -3,6 +3,7 @@ import { useSelector, useDispatch } from "react-redux"; import { add_todo, change_done, + remove_todo, select_todos, select_last_index, } from "./features/todo/reducer"; @@ -241,7 +242,9 @@ export function ListToDos() { <button type="button" className="btn btn-outline-dark" - disabled + onClick={(e) => + dispatch(remove_todo(item.id)) + } > Delete </button> |