Redux: Use const for Action Types error?

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:

It looks like this challenge is missing some comments. You also need to change lines 32 and 38.

I went ahead and opened a bug report for this.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.