-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering with new Breakpoints props do not refresh the layout #208
Comments
I just want to add that the problem is identical for the props "cols" |
You're correct, there should be hooks to refresh the state based on this. A memoized selector like |
Yeah I agree, It is always tricky to keep state up to date with props info. I just find out another issue in In Actually, the problem is that this line should not read I think that Could you provide fix on those points? or do you prefer i try a pull request? Thank you a lot for your work! I think it is totally amazing! I am trying to implement a live UI configurator that will allow a user to modify the responsive behavior of react-grid-layout in live! |
Thanks. I suspect you'll run into far more of these until I properly remove
|
|
Thank you. It works fine on my side! |
Hello,
I was using react-grid-layout on a responsive page and I made this page configurable in live by user. it means a user can see how the layout is displayed depending on how he has configured breakpoints. It is some kind of layout builder using react grid layout if you know what I mean. If the code is worth it at the end, I'll be happy to share it on github. The problem is that when React-grid-layout is rendered, if i fill it with a new props "breakpoints", nothing refreshes. I am under the impression that the function used to refresh the layout is called only when initializing the state: https://github.com/STRML/react-grid-layout/blob/master/lib/ResponsiveReactGridLayout.jsx#L81-L83 and should be called in componentWillReceiveProps when receiving a new breakpoints props too.
What do you think?
Thank you for your advice
The text was updated successfully, but these errors were encountered: