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 ?
Copyright © 2021 Jogjafile Inc.
The
state
will contain an object with all your reducers so check ifcounter
andisLogged
are the names of your reducers. I would suggest removing thestate.counter
and thestate.isLogged
on the return and checking what theconsole.log(state)
prints