Open dragidavid opened 3 weeks ago
+1 got this too.
I just started using react-three-fiber yesterday and thought I was losing my mind, glad I'm not the only one having this issue.
Here's what worked for me.
You'll need to put this in a file somewhere (e.g. a types.d.ts
file). Make sure to configure typeRoots in tsconfig.json to include the directory where you put the file
import { ThreeElements } from '@react-three/fiber'
declare global {
namespace React {
namespace JSX {
interface IntrinsicElements extends ThreeElements {
}
}
}
}
This fixed it for me. FWIW I'm using this library with preact with preact/compat and preact-reconciler
Hey all 👋
recently update to next 15/react 19 and since then I'm getting these errors for basic threejs elements like
ambientLight
,spotLight
and geometriesProperty 'ambientLight' does not exist on type 'JSX.IntrinsicElements'.ts(2339)
Anyone's got a fix or workaround for this?