What is the type of shaderMaterial from drei?

Hi,

What is the type of ShaderMaterial from three drei ? ? Is there documentation for that ?
I have this error
Property 'waveShaderMaterial' does not exist on type 'JSX.IntrinsicElements'.ts(2339)

for this code :

<mesh ref={couche1} position={[0, 0, 4]}>
<planeGeometry args={[image_size[0], image_size[1], 1, 1]} />
<waveShaderMaterial
// ref={shader2}
Thank you.

It hard to guess without seeing some code,

but if you are getting the error,

Property 'your-custom-object' does not exist on type 'JSX.IntrinsicElements'.

then you can add it to the the JSX namespace using something like this,

declare global {
  namespace JSX {
      interface IntrinsicElements {
          'your-custom-object': any;
      }
  }
}

E.g.,

I’m sure there is something more correct than any, but I don’t know what that could be yet.

1 Like