Import ToDoList Component
Understand how to import the ToDoList component and pass an array of tasks as props. Learn to implement an onDeleteHandler function that removes tasks by their unique IDs using the filter method. Discover how to maintain task state with React useState and preserve data with localStorage to build a functional Todo List app.
We'll cover the following...
We'll cover the following...
The ToDoList component
Let’s now import the ToDoList component and set the item and onDelete properties. The item property contains an array of tasks that are mapped over to display a list of tasks.
The onDeleteHandler method handles the onDelete function, which deletes the tasks based on their unique ids. We return the ToDoList component after importing the ...