Extract State Logic to Redux

Tell us what’s happening:

Your code so far


// define ADD, addMessage(), messageReducer(), and store here:
const ADD = 'ADD';

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

const messageReducer = (state = [], action)=> {
  switch(action.type){
    case ADD:
    return [...state,action.message]
    default:
    return state; 
  }
}

const store = Redux.createStore(messageReducer);

store.dispatch(addMessage())

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react-and-redux/extract-state-logic-to-redux

Your last line is causing the problem - remove it. It was not mentioned in the instructions. Yes, that is how you dispatch and action, but it is screwing up the tests.