Skip to content

What would be the ref type for components like Orbit-control #718

@WenheLI

Description

@WenheLI

Hi,

I was trying to use OrbitControl's ref in a typescript library. I am having a hard time finding what is the correct ref type for those components.

In the below code, does anyone would possibly know what would be the current type of control? (rather than any)

function app() {
    const control = useRef<OrbitControlsProps>()
    return (
        <Canvas>
            <ambientLight />
            <pointLight position={[10, 10, 10]} />

            <OrbitControls
                enablePan={true}
                enableZoom={true}
                enableRotate={true}
                ref={control}
            /> 
        </Canvas>     
    );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions