Skip to content

Commit

Permalink
Prevent skip change event in store when it occurs between render and …
Browse files Browse the repository at this point in the history
…componentDidMount
  • Loading branch information
davidshimjs committed Nov 16, 2016
1 parent 9035501 commit e0e9b2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/AltContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,11 @@ class AltContainer extends React.Component {
}
}

componentDidMount() {
componentWillMount() {
this._registerStores(this.props)
}

componentDidMount() {
if (this.props.onMount) this.props.onMount(this.props, this.context)
}

Expand Down
5 changes: 4 additions & 1 deletion src/mixinContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ const mixinContainer = (React) => {
this.registerStores(nextProps)
},

componentDidMount() {
componentWillMount() {
this.registerStores(this.props)
},

componentDidMount() {
if (this.props.onMount) this.props.onMount(this.props, this.context)
},

Expand Down

0 comments on commit e0e9b2b

Please sign in to comment.