Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mapdispatchtoprops

const mapDispatchToProps = (dispatch) => {
  return {
    // dispatching plain actions
    increment: () => dispatch({ type: 'INCREMENT' }),
    decrement: () => dispatch({ type: 'DECREMENT' }),
    reset: () => dispatch({ type: 'RESET' }),
  }
}

⭐ Note: We recommend using the object form of 
mapDispatchToProps unless you specifically 
need to customize dispatching behavior in some way.
 
PREVIOUS NEXT
Tagged: #mapdispatchtoprops
ADD COMMENT
Topic
Name
7+2 =