diff --git a/packages/wx-react-redux/miniprogram_dist/connect.js b/packages/wx-react-redux/miniprogram_dist/connect.js index 4ee30dc..6db7cd0 100644 --- a/packages/wx-react-redux/miniprogram_dist/connect.js +++ b/packages/wx-react-redux/miniprogram_dist/connect.js @@ -8,6 +8,7 @@ import shallowEqual from "./shallowEqual" import React, {HocComponent} from '@areslabs/wx-react' +import {bindActionCreators} from '@areslabs/wx-redux' import PropTypes from '@areslabs/wx-prop-types' export default function connect(mapStateToProps, mapDispatchToProps) { @@ -39,7 +40,10 @@ export default function connect(mapStateToProps, mapDispatchToProps) { let o2 = null - if (mapDispatchToProps) { + + if (mapDispatchToProps && typeof mapDispatchToProps === 'object') { + o2 = bindActionCreators(mapDispatchToProps, this.store.dispatch) + } else if (mapDispatchToProps && typeof mapDispatchToProps === 'function') { o2 = mapDispatchToProps(this.store.dispatch, this.props) } else { o2 = { diff --git a/packages/wx-react-redux/package.json b/packages/wx-react-redux/package.json index b68a30c..c64ed2a 100644 --- a/packages/wx-react-redux/package.json +++ b/packages/wx-react-redux/package.json @@ -1,6 +1,6 @@ { "name": "@areslabs/wx-react-redux", - "version": "1.0.2", + "version": "1.0.3", "description": "微信版本的react-redux", "main": "index.js", "scripts": {