cahilfoley / react-snowfall

A high performance, canvas based react component that creates a snowfall effect
https://cahilfoley.github.io/react-snowfall/
MIT License
389 stars 22 forks source link

UseLayoutEffect Error #62

Closed relativelyrehan closed 1 year ago

relativelyrehan commented 1 year ago
Screenshot 2022-12-26 at 12 31 27 AM

UseLayoutEffect Warning is coming. Please look into this

tomasconnor commented 1 year ago

+1 (Next.js)

cahilfoley commented 1 year ago

You can't use this component on the server as you can't access the DOM resources it requires (offscreen canvas etc.), you should only be using this component in your code that will only be rendered on the client (as the error message says).

You should be able to use something like client components (or dynamic imports in older version) to achieve it.