* update to hooks * more class to function * cleanup * finish ts final * update html lesson * add lessons page * clean up * move getters into context * adding type * fix bug * step 5 cleanup * init final pass * text tweak * fix ternaries * readme cleanup * fixed root readme
Step 1.7 - Types and creating a UI-driven state (Exercise)
If you don't already have the app running, start it by running npm start from the root of the frontend-bootcamp folder. Click the "exercise" link under day 1 step 7 to see results.
TodoFooter
-
Open TodoFooter and write a
TodoFooterPropsinterface. It should include two values, aclearCompletedandtodos. Use this interface in the function props like this:(props: TodoFooterProps) -
Write an
handleClickfunction that callsprops.clear. -
Assign
handleClickto the button'sonClickprop. -
Test out this functionality. Check a few todos complete and click the
Clear Completedbutton.
TodoHeader
-
Open TodoHeader then write and use the
TodoHeaderPropswhich will includeaddTodo,changeFilterandfilter. -
Add
onFilterto each of the filter buttons
- Note that we can't add new parameters to onClick, but we can pull information from the event target!
-
Call
onSubmitfrom the submit button -
Check out this new functionality! We can now add and filter todos!