login: false
};
const reducer = (state = defaultState, action) => {
// Change code below this line
// console.log(state.login)
return action.type === "LOGIN" ? state.login = true : state
// Change code above this line
};
const store = Redux.createStore(reducer);
const loginAction = () => {
return {
type: 'LOGIN'
}
};
while on console, I can see that state.login logs the correct value, the above given code doesn’t work.
can you please help me with this piece of code?