cedricdelpoux / react-responsive-masonry

React responsive masonry component built with css flexbox
https://cedricdelpoux.github.io/react-responsive-masonry/
MIT License
362 stars 37 forks source link

is there a way we can refresh the list? #65

Closed mike1011 closed 2 years ago

mike1011 commented 2 years ago

For example -


                    <ResponsiveMasonry
                      columnsCountBreakPoints={{
                        350: 1,
                        750: 3,
                        900: 4
                      }}
                    >
                      <Masonry gutter={'15px'}>
                        {items.map((item) => {
                            <somecustomcomponent />
                        }))
                      </Masonry>
                   </ResponsiveMasonry>

If i want to delete/remove the custom component and also refresh the list, so that it can rearrange the list or trigger it to rearrange again. How can I do it?

mike1011 commented 2 years ago

Well, I simply used display:none dynamically and this triggered the grid to auto adjust again. Initially, I was using visibility:hidden, but seems display:none did the trick.