R3F how can I get the camera controls through the hook get()

  Kiến thức lập trình

In a model class I’m calling the r3f hook get() to the camera controls

const { raycaster, camera, scene, gl, controls } =

the console log prints it as a camera control object. However, typescript is recognizing the object as a THREE.EventDispatcher | null type.
How can I get the camera controls from the get() state?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website