The problem is that you are explicitly writing out the strings instead of using the constants you created at the top of you file.
For example you have:
case 'LOGIN':
return {
authenticated: true
}
You should be using the constant there. For example if I had a delete action, I would have:
const DELETE = 'DELETE';
//...
case DELETE:
// whatever we need to do to delete
// ...
const DELETE = () => {
return {
type: DELETE
}
};
Notice that I’m using the constant and not the string. You have to change this is four places - twice in your reducer and once for each action creator.
Why do it this way? I thought it was silly at first especially because they basically say the same thing. But there are very good reasons for it, not least of which that they are less error prone and more maintainable.
You need to make a similar change here. That’s what the error message is telling you: “The action creators and the reducer should reference the LOGIN and LOGOUT constants.” You are still using strings in your action creators, not the constants.