Open foufrix opened 1 year ago
adding if (typeof window === 'undefined') return <></>;
before the return component trigger a new issue
Error: Hydration failed because the initial UI does not match what was rendered on the server.
adding
if (typeof window === 'undefined') return <></>;
before the return component trigger a new issueError: Hydration failed because the initial UI does not match what was rendered on the server.
Did you manage to solve this @foufrix ? Have the same issue, it also clobbers fast-refresh
Hi, I just tried to make the code snippet works with NextJS.
I have as error
document not find
fromnodetick
:error - ReferenceError: document is not defined at de (/Users/raf/Documents/project/node_modules/@nodetoy/react-nodetoy/dist/react-nodetoy.umd.js:1:1490)
I then implemented the shader as a standalone component and import it using
next/dynamic
with SSR off:Shader.tsx
App.tsx
This bypass the
document
error but triggerError: R3F: Hooks can only be used within the Canvas component!
.Any idea on how to solve that? A nextjs implementation would be helpful, thanks 🙏