cedricdelpoux / react-responsive-masonry

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

No longer works in Next.js 14? #125

Closed oelbaga closed 3 months ago

oelbaga commented 3 months ago

This package doesn't seem to work with the most recent Next JS 14 version even in a client component. Just loading the default code brings up these errors in the console:

Internal error: ReferenceError: window is not defined
    at useWindowWidth (../node_modules/react-responsive-masonry/es/ResponsiveMasonry/index.js:28:68)
    at MasonryResponsive (../node_modules/react-responsive-masonry/es/ResponsiveMasonry/index.js:60:21)
cedricdelpoux commented 3 months ago

Can you checkout v2.3.0? It should resolve the issue