Open kleisberg opened 1 year ago
The backgrounds that use Three should have the same process as using React.
Regarding the backgrounds that use p5, I was able to use it in Next by following the same steps as React, but with some minor changes.
"use client"
to the top of the file, to indicate to Next to run the page client-sided.const Background = dynamic(() => import("@/components/background").then(mod => mod.Background), { ssr: false })
(Make sure to change the variable name and path for your needs~~)Hope this brings you success, I struggled with this problem too 😅
@treetreet0rrm0uth Do you have a working example like a repo/jsfiddle or similar? I believe I want to use NET or WAVES as the background in root layout. Would be greatly appreciated 😄
- const Background = dynamic(() => import("@/components/background").then(mod => mod.Background), { ssr: false })
Do you have an example? I deal with[VANTA] Init error TypeError: T
is undefined after following your steps.
@treetreet0rrm0uth Do you have a working example like a repo/jsfiddle or similar? I believe I want to use NET or WAVES as the background in root layout. Would be greatly appreciated 😄
I absolutely agree. there is a small documentation for react but it would be nice to create a documentation for next.js as well.
hello i tried to use it with Next.js , but I couldn't get it to work. is there an example piece of code available?