Skip to content

Commit

Permalink
Dispatch sizes again when the props are updated (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncuillery authored and renatorib committed Jul 10, 2018
1 parent c03795a commit 0df6318
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/withSizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const withSizes = (...mappedSizesToProps) => WrappedComponent => {

/* Lifecycles */

componentWillReceiveProps() {
this.dispatchSizes()
}

componentDidMount() {
window.addEventListener('resize', this.throttledDispatchSizes)
this.dispatchSizes()
Expand Down

0 comments on commit 0df6318

Please sign in to comment.