Currently, I'm utilizing React Three Fiber in combination with TypeScript to type my React Application. Here is a snippet of the code I am working on:
return (
<group ref={group} dispose={null}>
<scene name="Scene" {...props}>
<mesh
ref={mesh}
scale={1.5}
name="Object_0"
morphTargetDictionary={nodes.Object_0.morphTargetDictionary}
morphTargetInfluences={nodes.Object_0.morphTargetInfluences}
rotation={[Math.PI / 2, 0, 0]}
geometry={nodes.Object_0.geometry}
material={materials.Material_0_COLOR_0}
/>
</scene>
</group>
);
However, a persistent error keeps occurring:
Property: 'morphTargetDictionary' does not exist on type 'Object3D<Event>
, and a similar issue persists with morphTargetInfluences as well as geometry.
I attempted the following solution as I believe that these properties need to be included within the declaration of the Object3D
(I am using the npm package @types/three
), but unfortunately, it did not yield any positive results.
declare module '@types/three' {
export default interface Object3D {
morphTargetDictionary: number;
morphTargetInfluences: number
geometry: string
}
}
Thank you in advance for your assistance!