使用react+redux實現彈出框案例( 二 )

  1. 因為使用 combineReducers 合并reducer的時候改變了state的結構所以我們需要在組件中去更改獲取state的方式
// src/components/Count.jsconst mapStateProps = ({ counter }) => ({count: counter.count,a: '1'})// src/components/Modal.jsconst mapStateToProps = ({ modaler }) => {return {showState: modaler.show}}

推薦閱讀