Manually load reactive masonry component

Used by React Masonry Plugin for my map alignment https://github.com/eiriklv/react-masonry-component

The problem is that I have an extensible component in the cards, which increases the height of the card and the layout of the masonry is distorted. The plugin reconfigures if the data state is updated or is running on a scroll. Any idea how to reload the layout manually on extensible content. Problems with plugins were also checked, but no suitable solution was found. Any other pf shell response or plugin recommendations for this scenario? Thank you for your help in advance.

I know that with jQuery I can use methods reloadItemsand layout, but I try to avoid jquery

+4
source share
2 answers

I had to face a similar problem in which I wanted to remasonrize (if you like) after each show / hide div switch.
In my case, I had component A as a parent (with component <Masonry>) and components B1, B2 ... Bn inside it.

Each time I switch (in your case, resizing) to B1, B2 ... Bn, it updates state A, causing the Freemasonry component to display again.

If you post a sample code, I can help you with the exact code.

-1
source

Source: https://habr.com/ru/post/1621227/


All Articles