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
Hello,
I've been working on an avatar creator and we have this OrbitControls that is working fine in JS until we move our code to Typescript.
Part of the code is this
The error is in line enableRotateVertical that says
Type '{ ref: RefObject; makeDefault: true; enableRotate: true; autoRotate: false; enablePan: false; enableZoom: false; zoomSpeed: number; minPolarAngle: number; maxPolarAngle: number; enableRotateVertical: boolean; }' is not assignable to type 'IntrinsicAttributes & OrbitControlsProps & RefAttributes'.
Property 'enableRotateVertical' does not exist on type 'IntrinsicAttributes & OrbitControlsProps & RefAttributes'.ts(2322)
I found some solution on stackoverflow but it doesn't work with me. I add type in the useRef that goes like this
`import type { OrbitControls as OrbitControlsImpl } from 'three-stdlib'
const controlRef = useRef<OrbitControlsImpl>(null)`
this is coming from the stackoverflow post I saw that is somehow related to my problem but still got the same error.
Can anyone help me with this? I need the enableRotateVertical assigned as false because the model have this weird behavior that can be solve using this props that is working fine in Javascript file but not in TS.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I've been working on an avatar creator and we have this OrbitControls that is working fine in JS until we move our code to Typescript.
Part of the code is this
The error is in line enableRotateVertical that says
I found some solution on stackoverflow but it doesn't work with me. I add type in the useRef that goes like this
this is coming from the stackoverflow post I saw that is somehow related to my problem but still got the same error.
Can anyone help me with this? I need the enableRotateVertical assigned as false because the model have this weird behavior that can be solve using this props that is working fine in Javascript file but not in TS.
I will appreciate any help. Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions