Skip to content

Commit

Permalink
fix(taro-redux): redux 兼容 getDerivedStateFromProps,close #3929
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Aug 2, 2019
1 parent eaa0eae commit 4d950d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/taro-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"typings": "types/index.d.ts",
"scripts": {
"test": "jest",
"dev": "rollup -c rollup.config.js -w",
"build": "rollup -c rollup.config.js"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions packages/taro-redux/src/connect/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export default function connect (mapStateToProps, mapDispatchToProps) {
})
}

componentWillMount () {
_constructor () {
const store = getStore()
Object.assign(this.props, mergeObjects(mapStateToProps(store.getState(), this.props), initMapDispatch))
unSubscribe = store.subscribe(stateListener.bind(this))
if (super.componentWillMount) {
super.componentWillMount()
if (super._constructor) {
super._constructor(this.props)
}
}

Expand Down

0 comments on commit 4d950d0

Please sign in to comment.