In my React application I've set a timer that polls for new posts from a certan API. Whenever a new post is fetched, the component that holds the Masonry component receives the updated array of posts causing the render() method to trigger. This causes the whole grid to be re-rendered (all the items do the animation, instead of just the new ones).
In the old project I used to do that the masonry docs says:
$grid.prepend( $items )
// add and lay out newly prepended items
.masonry( 'prepended', $items );
How to achieve such behavior with react and react-masonry-component?
I'm new to React so maybe this is not related specifically to your component. I'm sorry if that's the case.
In my React application I've set a timer that polls for new posts from a certan API. Whenever a new post is fetched, the component that holds the Masonry component receives the updated array of posts causing the
render()
method to trigger. This causes the whole grid to be re-rendered (all the items do the animation, instead of just the new ones).In the old project I used to do that the masonry docs says:
How to achieve such behavior with
react
andreact-masonry-component
?I'm new to React so maybe this is not related specifically to your component. I'm sorry if that's the case.