Open Kerumen opened 3 years ago
+1 on this, makes a lot of noise in the log when developing with Next.js
@mysterybear can you test the PR and give feedback? I'll merge then 👍
Hi @gsimone thanks for quick reply, I've tested using JS and it seems to work fine here: https://codesandbox.io/s/github/mysterybear/tweaks-next-ssr-use-effect-test?file=/pages/index.js
I just took the example codesandbox code and pasted it into a Next.js project and pointed use-tweaks at the patch author's branch, hope that's okay
Edit: wanted to try with TS too, but getting the same problem as #43 even with v0.3.1
Any chance this gets ever merged ?
Hey @enzoferey (and @mysterybear), we pretty much moved all efforts to https://github.com/pmndrs/leva; if you want to help with use-tweaks, let me know and I can make you maintainer 👍
When SSR,
useLayoutEffect
prints a warning. This PR fixes this by swapping the hook with auseEffect
if we are on the server. This is a common way to solve this problem: