Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

property does not exist on JSX.IntrinsicElements - ts(2339) #3385

Open
dragidavid opened this issue Oct 27, 2024 · 2 comments
Open

property does not exist on JSX.IntrinsicElements - ts(2339) #3385

dragidavid opened this issue Oct 27, 2024 · 2 comments

Comments

@dragidavid
Copy link

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 geometries

Property 'ambientLight' does not exist on type 'JSX.IntrinsicElements'.ts(2339)

Screenshot 2024-10-27 at 23 14 08

Anyone's got a fix or workaround for this?

@mmmoli
Copy link

mmmoli commented Oct 29, 2024

+1 got this too.

@kumikumi
Copy link

kumikumi commented Oct 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants