Tell us what’s happening:
I can’t see anything else missing.It won’t let me pass
// running tests
The action creators and the reducer should reference the LOGIN and LOGOUT constants.
// tests completed
Your code so far
// Change code below this line
const LOGIN = 'LOGIN';
const LOGOUT = 'LOGOUT';
// Change code above this line
const defaultState = {
authenticated: false
};
const authReducer = (state = defaultState, action) => {
switch (action.type) {
case LOGIN: // Change this line
return {
authenticated: true
}
case LOGOUT: // Change this line
return {
authenticated: false
}
default:
return state;
}
};
const store = Redux.createStore(authReducer);
const loginUser = () => {
return {
type: 'LOGIN'
}
};
const logoutUser = () => {
return {
type: 'LOGOUT'
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:85.0) Gecko/20100101 Firefox/85.0
.
Challenge: Use const for Action Types
Link to the challenge: