-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 'mesh' does not exist on type 'JSX.IntrinsicElements'. #2681
Comments
Did you import from |
Same here. Not sure how this is happening. How to properly set up/fix would be appreciated. |
Make sure that you're importing Show Example// https://docs.pmnd.rs/react-three-fiber/getting-started/introduction#what-does-it-look-like?
import * as THREE from 'three'
import { createRoot } from 'react-dom/client'
import React, { useRef, useState } from 'react'
import { Canvas, useFrame, ThreeElements } from '@react-three/fiber'
function Box(props: ThreeElements['mesh']) {
const mesh = useRef<THREE.Mesh>(null!)
const [hovered, setHover] = useState(false)
const [active, setActive] = useState(false)
useFrame((state, delta) => (mesh.current.rotation.x += delta))
return (
<mesh
{...props}
ref={mesh}
scale={active ? 1.5 : 1}
onClick={(event) => setActive(!active)}
onPointerOver={(event) => setHover(true)}
onPointerOut={(event) => setHover(false)}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color={hovered ? 'hotpink' : 'orange'} />
</mesh>
)
}
createRoot(document.getElementById('root')).render(
<Canvas>
<ambientLight />
<pointLight position={[10, 10, 10]} />
<Box position={[-1.2, 0, 0]} />
<Box position={[1.2, 0, 0]} />
</Canvas>,
) If you need any further help, create a discussion or ask in https://discord.gg/poimandres. |
Well, I had the same issue and after a while I noticed that I had named my npm project Decided to share as it could help someone |
|
If anyone else is running into this recently and found this issue on google, and is on Next 15 / React 19 check these out: Duplicate of #3385 |
I followed your introduction page but got the error:
Property 'mesh' does not exist on type 'JSX.IntrinsicElements'.
my dependencies
I tried to downgrade the version of
three
andtypes/three
but it still did not workmy code:
pls help me to fix this issue. thanks
The text was updated successfully, but these errors were encountered: