In this lesson we quickly migrate our <RateTable>
and <CurrencyCodePicker>
to the Redux Hooks API. Nothing new is covered here that isn't covered in our previous lessons, but I am hoping it will be useful to practice this technique and also to see how rapidly we can convert these components to the new syntax.
What's stopping you from using these techniques in your own app!?
import useSelector
and useDispatch
mapStateToProps
to the top of your component and convert each line to its own variable, pulled in with useSelector
hookdispatch
function with useDispatch()
dispatch
or create a function with the same name as the variable.mapStateToProps
and the mapDispatchToProps
functionconnect()
but we saved that for another lesson :D