UNPKG

react-native-vision-camera

Version:

VisionCamera is the fastest and most powerful Camera for react-native.

34 lines (33 loc) 1.01 kB
import { getHostComponent } from 'react-native-nitro-modules'; /** * The `<NativePreviewView />` component. * * The higher-level {@linkcode Camera} component * renders this native component under the hood. * * The `<NativePreviewView />` requires a {@linkcode CameraPreviewOutput} * that is also connected to a {@linkcode CameraSession} to * display a live Camera feed. * * @see {@linkcode PreviewView} * @see {@linkcode PreviewViewProps} * @see {@linkcode PreviewViewMethods} * @example * ```tsx * function App() { * const previewView = useRef<PreviewView>(null) * const previewOutput = usePreviewOutput() * * return ( * <NativePreviewView * style={StyleSheet.absoluteFill} * previewOutput={previewOutput} * hybridRef={callback((r) => { * previewView.current = r * })} * /> * ) * } * ``` */ export const NativePreviewView = getHostComponent('PreviewView', () => require('../../nitrogen/generated/shared/json/PreviewViewConfig.json'));