Learn Topics: Lifting State Up required for this wave
In Wave 03 we will update the Task List Front End to store state in the App
. For this wave you should make sure that that you are on the main
branch.
Lifting up state will set us up to connect our front end to our back end API.
We will update and implement the following features:
- Update the toggle
complete
feature of eachTask
to update the state of the task data stored inApp
. - Add a feature to delete a
task
from the task data stored and rendered by theApp
.
Expand for hints on lifting the state up to App
- Remove state from the
Task
component and instead simply render the props. - Update
App.jsx
to store the list of task data in state. - Update the data passed to
TaskList
through props to use the task data stored in state.
Expand for hints on updating the toggle complete feature.
- Build a function to update an individual task (toggling its
isComplete
field) inApp
.- This function will need the
id
of the task to modify. - This function will need to update the task data stored in state.
- This function will need the
- Pass this function as a callback through
TaskList
toTask
- Update button to receive the callback function in the
onClick
attribute.
Expand for hints on implementing the delete feature.
- Build a function to delete an individual task in
App
.- This function will need the
id
of the task to delete. - This function will need to update the task data stored in state.
- This function will need the
- Pass this function as a callback through
TaskList
toTask
- Update button to receive the callback in the
onClick
attribute.