const mapStateToProps = state => {
console.log(state);
return {
counter: state.counter,
isLogged: state.isLogged
}
}
This is how I passed the states. However, error comes saying counter and isLogged is undefined. Why ?
const mapStateToProps = state => {
console.log(state);
return {
counter: state.counter,
isLogged: state.isLogged
}
}
This is how I passed the states. However, error comes saying counter and isLogged is undefined. Why ?
The state
will contain an object with all your reducers so check if counter
and isLogged
are the names of your reducers. I would suggest removing the state.counter
and the state.isLogged
on the return and checking what the console.log(state)
prints