-
Notifications
You must be signed in to change notification settings - Fork 66
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
my cards always rerender #51
Comments
I have the same issue. How to solve it? Thanks @paulcollett @Noobday @dandv |
I figured out the cause of continuous mounting and unmounting I was changing the number of columns of masonry layout and react was continuously constructing the layout with cards When a card moves from a column to another column it unmount and mount for that i did put a constant number of columns and the problem was solved |
I checked the code of library i found that some sort of transformation to the component childrens caused the rerender
and in the render he is displaying the array
without this transformation everything works normally |
hope u got an idea about why i got this issue and how i solved it also what causes the render hell |
thank you so much @Noobday |
to confirm, this re-render only occurs on a column count change? If so, that's an expected trade-off due to this technique which requires wrapping each column in an extra We've looked into various workarounds, like If this affects your Component's state, we suggest lifting the state above Masonry. |
yep that's it |
After wrapping my cards with react-masonry-css the shouldComponentUpdate in my card component is ignored and my cards keeps rendering !
can someone help me how to solve this issue ?
The text was updated successfully, but these errors were encountered: