Tell us what’s happening:
I don’t see any error in js, the test results are Cannot read property 'type' of undefined for all the cases. What am I missing?
Your code so far
// define ADD, addMessage(), messageReducer(), and store here:
const ADD = 'ADD';
const addMessage = (message) => {
return {
type: ADD,
message: message
}
}
const defaultState = [];
const messageReducer = (state = defaultState, action) => {
switch(action.type){
case ADD:
return [...state, action.message];
break;
default:
return state;
}
}
const store = Redux.createStore(messageReducer());
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36.
Link to the challenge: