Tell us what’s happening:
why the value of action.type = @@redux/INIT instead of LOGIN
as defined
with this case i cant check if login action is sent or not
couldnt find something like this on the forums
or even the internet
Your code so far
const defaultState = {
login: false
};
const reducer = (state = defaultState, action) => {
// change code below this line
console.log(action.type)
if(action.type==='LOGIN'){
return state.login=true;
}else {
return state;
}
// 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/75.0.3770.100 Safari/537.36
.
Link to the challenge: