You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am also having the problem with TransformControls
when using drei with TypeScript
Type 'RefObject<Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>' is not assignable to type 'MutableRefObject<Object3D<Object3DEventMap>>'.
Types of property 'current' are incompatible.
Type 'Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | null' is not assignable to type 'Object3D<Object3DEventMap>'.
Type 'null' is not assignable to type 'Object3D<Object3DEventMap>'.ts(2322)
TransformControls.d.ts(7, 5): The expected type comes from property 'object' which is declared here on type 'IntrinsicAttributes & Omit<TransformControlsProps, "ref"> & RefAttributes<TransformControls<Camera>>'
Argument of type 'RefObject<DirectionalLight>' is not assignable to parameter of type 'MutableRefObject<Object3D<Object3DEventMap>> | Falsy'.
Type 'RefObject<DirectionalLight>' is not assignable to type 'MutableRefObject<Object3D<Object3DEventMap>>'.
Types of property 'current' are incompatible.
Type 'DirectionalLight | null' is not assignable to type 'Object3D<Object3DEventMap>'.
Type 'null' is not assignable to type 'Object3D<Object3DEventMap>'.ts(2345)
Any solutions?
UPDATE:
Disabling strictNullChecks in the tsconfig.json fixes the error.
"@react-three/drei": "^9.57.0",
"@react-three/fiber": "^8.11.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"three": "^0.150.1"
Problem description:
how to use useHelper with DirectionalLight in typescript.
I get similar type error when using TransformControls as well.
Relevant code:
Suggested solution:
can you share any typescript examples ?
issue with TransformControls as well
The text was updated successfully, but these errors were encountered: