mapStateToProps
1
2
3
4
5
const mapStateToProps = (state /*, ownProps*/) => {
return {
counter: state.counter
}
}
参考链接
https://react-redux.js.org/introduction/basic-tutorial
1
2
3
4
5
const mapStateToProps = (state /*, ownProps*/) => {
return {
counter: state.counter
}
}
https://react-redux.js.org/introduction/basic-tutorial