Hands-on practice for this lecture. Write the code, see it run, understand the pattern.
Exercise 1 of 1
useSelector is working. Wire the Add and Delete buttons with useDispatch — three steps, fully interactive task manager.
Task
useSelector is working — the initial task renders. Now wire the buttons using useDispatch.
useDispatch() to get dispatchaddTask: dispatch ADD_TASK with { id: Date.now(), text: input }, then clear inputdeleteTask: dispatch DELETE_TASK with the task id as payload