So my issue is that I want to add my custom components into my scene. But these custom components will be defined in a different file. So when I define my custom component all three-fiber components come across as
Cannot find name 'planeGeometry'. Did you mean 'PlaneGeometry'?
My app is written in Typescript. I tried it in sandbox for Javascript it was working fine. Maybe I didn't set up @react-three/fiber properly since even adding props to the component give error.
Say I want to add a plane mesh into my scene, Plane Mesh defined in Ground.ts and My Scene defined in Scene.ts
Scene.ts:
import {Ground} from './Ground' const Scene =()=>{ return ( <Canvas> <Ground /> </Canvas> ); };
Ground.ts
import {useTexture} from '@react-three/drei'; export const Ground = () => { const groundUrl = "<url_here>"; const texture = useTexture(groundUrl); return ( <mesh> <planeGeometry args={[120, 120]} /> <meshStandardMaterial map={texture} /> </mesh> ); };
Here the components mesh, planeGeometry, meshStandardMaterial all give give errors as not found component. Is there any other step that I'm missing. I'm not very familiar with Typescript so I probably missed a few things.