Redux - Handle an Action in the Store

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

const defaultState = {
  login: false
};

const reducer = (state = defaultState, action) => {
  // Change code below this line

  // Change code above this line
};

const store = Redux.createStore(reducer);

const loginAction = () => {
  return {
    type: 'LOGIN'
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Challenge: Redux - Handle an Action in the Store

Link to the challenge:

You didn’t write any code.

Also, it would be helpful if you asked a question so we can explain what it is specifically you do not understand.


  1. You need a conditional check or switch.

  2. It should check the action.type for the value LOGIN

  3. If the action type is LOGIN return a new object with the login property set to true

  4. If the action type is not LOGIN return the state object unchanged.

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