Closed sarathjasrin closed 7 months ago
Hi @cedricdelpoux ,
When we render the Masonry child, sometimes we add an if condition to check if the element is valid.
const images = [ "https://picsum.photos/200/300?image=1050", null, "https://picsum.photos/400/400?image=1039", null, "https://picsum.photos/400/400?image=1080", ] <Masonry columnsCount={3} gutter="10px"> {images.map((image, i) => image ? ( <img key={i} src={image} style={{width: "100%", display: "block"}} /> ) : ( "" ) )} </Masonry>
In those cases, we may return unwanted empty or null children. This is causing uneven children inside the masonry getColumns function.
getColumns
Sorry for the delay 😞 It published in 2.2.0. Thank you for your help !
2.2.0
Hi @cedricdelpoux ,
When we render the Masonry child, sometimes we add an if condition to check if the element is valid.
In those cases, we may return unwanted empty or null children. This is causing uneven children inside the masonry
getColumns
function.