CONTACT US

React TL;DR – a human filter for most useful tech content.

All posts

Redux Now Has Hooks. A Before and After Comparison

  • useSelector: Pass in a function that takes the state as an argument and returns a value. Used to get a single value from state. Can act as a replacement for mapStateToProps.
  • useDispatch: returns a reference to the dispatch object. It can act as a replacement for mapDispatchToProps.
  • useStore: returns an instance of the store. Generally not recommended.