Map Dispatch to Props help

Tell us what’s happening:
This code is working but I want to know can I write mapDispatchToProps function like this:

function mapDispatchToProps(dispatch){

and call it component props like:


is it correct?

Your code so far

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

// change code below this line
function mapDispatchToProps(dispatch) {

  return {
    submitNewMessage :(newMessage)=>{ dispatch(addMessage(newMessage)) }   


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge: