loading...

React tldr; Redux Now Has Hooks

maniekm profile image Mariusz Updated on ・1 min read
  • 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.

Source: https://glennstovall.com/react-hooks-before-and-after/?utm_source=reactdigest&utm_medium=web&utm_campaign=featured

Discussion

markdown guide