paulcollett / react-masonry-css

React Masonry layout component powered by CSS, dependancy free
https://paulcollett.github.io/react-masonry-css/demo/
MIT License
961 stars 66 forks source link

Anyone has issue on init render? #95

Closed accountunavaible closed 4 months ago

accountunavaible commented 4 months ago

hi all, I am trying to render dynamically by passing down breakPointCols props.

here is the prop obj { default: 5, 1000: 4, 900: 3, 640: 2, }

When I am under 640px device, and I click refresh, it will first render the default 5 cols then it becomes 2. Anyone knows how to solve this? (message: I dont want to use another state to calculate if this mount is finished or not, if anyone could provide a faster solution for this :)) )

I am running on Next.JS project. Thank you very much!

accountunavaible commented 4 months ago

yeah, I have searched a way for this, but seems I have to use another state to control of it, since it is about nextjs hydration thing.

leave this message here, in case anyone having same issue from me