使用Redux报错
undefined is not an object (evaluating 'reducerX.yyy')
Unhandled JS Exception: undefined is not an object (evaluating 'reducerX.yyy')
解决:在对应的组件加上
function mapStateToProps(state) {
const { reducerX } = state;
return {
reducerX
}
}
export default connect(mapStateToProps)(组件名)