Skip to main content

Function: useCamera()

useCamera(options?): object

React hook that helps you to manage the camera.

const {zoomIn, zoomOut, reset, goto, gotoNode } = useCamera();

Parameters

options?: CameraOptions

Returns

object

goto()

goto: (state, options?) => void

Parameters

state: Partial<CameraState>

options?: Partial<AnimateOptions>

Returns

void

gotoNode()

gotoNode: (nodeKey, options?) => void

Parameters

nodeKey: string

options?: Partial<AnimateOptions>

Returns

void

reset()

reset: (options?) => void

Parameters

options?: Partial<AnimateOptions>

Returns

void

zoomIn()

zoomIn: (options?) => void

Parameters

options?: CameraOptions

Returns

void

zoomOut()

zoomOut: (options?) => void

Parameters

options?: CameraOptions

Returns

void

Defined in

packages/core/src/hooks/useCamera.ts:19