Open jelling opened 2 months ago
Your React installation is duplicated, including types, which breaks features like context. Try a clean install or bring this upstream if something regressed with Next and their internal copy of React (yes, they do this and it creates tons of headache here).
Using the example code inside of a
Next 14.1
app throws"R3F: Hooks can only be used within the Canvas component!"
My code:
I also tried a) hoisting the
Canvas
and wrapping the canvas contents that component and b)puttinguse client
at the top of the page. But I got the same error no matter what.Not certain if it's related, but in VSCode I'm getting this error:
Any ideas? There are a few older closed issues related to Next.js so not surprised if that's the issue somehow.