Map Dispatch to Props -React/Redux

Tell us what’s happening:

It says dispatch is not defined

Your code so far

const addMessage = (message) => {
  return {
    type: 'ADD',
    message: message

// change code below this line
function mapDispatchToProps(newMessage) {
  return {
    submitNewMessage: function(newMessage){

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:

Yes, because you do not define what dispatch is before using it.

Hint: No need to define dispatch, but if you read the following sentence of the challenge instructions, it tells you what you should do.

Write the function mapDispatchToProps() that takes dispatch as an argument, then returns an object.