askides / react-plock

The 1kB Masonry Grid for React.

Home Page:https://react-plock-with-nextjs.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UseLayoutEffect warning in NextJs

bosbode opened this issue · comments

When using this package in NextJs, I get the following warning:

Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.

Any chance for SSR support?

Hi, i will handle this issue!

Hi, just released a major version which includes also a fix for your issue. Tested in Next.js and there are no more errors.

Please, check out a couple of little breaking changes in the API, and have a look at the v2.0.0 changelog!

Enjoy!