Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dispatch sizes again when the props are updated #30

Merged
merged 1 commit into from
Jul 10, 2018

Conversation

ncuillery
Copy link
Contributor

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().

@renatorib renatorib merged commit 0df6318 into renatorib:master Jul 10, 2018
@renatorib
Copy link
Owner

renatorib commented Jul 10, 2018

Thanks @ncuillery!
I'll publish a patch version soon.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants