Skip to content

Instantly share code, notes, and snippets.

@jepras
Created October 21, 2018 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jepras/3c93df45d6cb9bd14e187055f8201f91 to your computer and use it in GitHub Desktop.
Save jepras/3c93df45d6cb9bd14e187055f8201f91 to your computer and use it in GitHub Desktop.
mapDispatchToProps takes the dispatch function as a parameter and then returns that function with the property of the addMessage action creator
const addMessage = (message) => {
return {
type: 'ADD',
message: message
}
};
// change code below this line
const mapDispatchToProps = dispatch => {
return {
submitNewMessage: function(message) {
dispatch(addMessage(message));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment