Skip to content

Commit 0df6318

Browse files
ncuilleryrenatorib
authored andcommitted
Dispatch sizes again when the props are updated (renatorib#30)
1 parent c03795a commit 0df6318

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/withSizes.js

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ const withSizes = (...mappedSizesToProps) => WrappedComponent => {
5959

6060
/* Lifecycles */
6161

62+
componentWillReceiveProps() {
63+
this.dispatchSizes()
64+
}
65+
6266
componentDidMount() {
6367
window.addEventListener('resize', this.throttledDispatchSizes)
6468
this.dispatchSizes()

0 commit comments

Comments
 (0)