mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
Step 2.6: Redux: React Binding (Exercise)
Bind Redux Store with Class Component
-
Open
exercise/src/components/TodoHeader.tsx. -
Just like the 2.4 exercise, implement
onAddandonFilterusingthis.context.dispatch()calls to dispatch actions.
Bind Redux Store with Functional Component
-
Open
exercise/src/components/TodoFooter.tsx. -
Follow the instructions in the file to replace the
todosconst using theuseMappedState()hook. -
Retrieve the dispatch function with
useDispatch()hook.