react-native-vision-camera
Version:
VisionCamera is the fastest and most powerful Camera for react-native.
17 lines (15 loc) • 543 B
text/typescript
import { useMemo } from 'react'
import type { OrientationSource } from '../../specs/common-types/OrientationSource'
import type { OrientationManager } from '../../specs/orientation/OrientationManager.nitro'
import { VisionCamera } from '../../VisionCamera'
export function useOrientationManager(
source: OrientationSource | undefined,
): OrientationManager | undefined {
return useMemo(() => {
if (source != null) {
return VisionCamera.createOrientationManager(source)
} else {
return undefined
}
}, [source])
}