The "Mess with props" example in the README.md file doesn't work if the component property (mobileBreakpoint in that example) is dynamic.
Let's imagine you have a slider to adjust the value of that props. If you interact with the slider once the component is mounted (componentDidMount has been called), the mapSizesToProps is not called until the window is resized.
This PR simply adds a componentDidUpdate method which triggers this.dispatchSizes().
The "Mess with props" example in the README.md file doesn't work if the component property (
mobileBreakpoint
in that example) is dynamic.Let's imagine you have a slider to adjust the value of that props. If you interact with the slider once the component is mounted (
componentDidMount
has been called), themapSizesToProps
is not called until the window is resized.This PR simply adds a
componentDidUpdate
method which triggersthis.dispatchSizes()
.