1.1 KiB
Step 2.7: Connect Redux Store to View (Exercise)
If you still have npm test running from the last step, stop it using ctrl+C. Start the app by running npm start from the root of the frontend-bootcamp folder. Click the "exercise" link under day 2 step 7 to see results.
-
open up
exercise/src/index.tsxand wrap<TodoApp>with<Provider>as instructed in the comment -
open up
exercise/src/components/TodoFooter.tsxand erase the "nullable" type modifier (i.e. the ?) in the interface definition ofTodoFooterProps -
Remove the
exportfromexport const TodoFooter = (props: TodoFooterProps) => { -
uncomment the bottom bits of code and fill in the implementation for
mapStateToProps()andmapDispatchToProps()- feel free to useTodoListItem.tsxas a guide -
do steps 2, 3, and 4 for the
TodoHeader.tsxfile
Bonus Exercise
For further reading, go here to look up more information about the mergeProps and options parameters to connect():