fix docs
This commit is contained in:
parent
b9d5bd0294
commit
d3c19a4f8c
@ -66,10 +66,17 @@ The react-native-vision-camera library provides a hook to make camera device sel
|
||||
|
||||
You can specify a device type to only find devices with the given type:
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
function App() {
|
||||
const devices = useCameraDevices('wide-angle-camera')
|
||||
const device = devices.back
|
||||
|
||||
return (
|
||||
<Camera
|
||||
style={StyleSheet.absoluteFill}
|
||||
device={device}
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
@ -77,9 +84,16 @@ Or just return the "best matching camera device". This function prefers camera d
|
||||
|
||||
> Example: `triple-camera` > `dual-wide-camera` > `dual-camera` > `wide-angle-camera` > `ultra-wide-angle-camera` > `telephoto-camera` > ...
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
function App() {
|
||||
const devices = useCameraDevices()
|
||||
const device = devices.back
|
||||
|
||||
return (
|
||||
<Camera
|
||||
style={StyleSheet.absoluteFill}
|
||||
device={device}
|
||||
/>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
@ -60,12 +60,7 @@ function App() {
|
||||
console.error(error)
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Camera
|
||||
style={StyleSheet.absoluteFill}
|
||||
onError={onError}
|
||||
/>
|
||||
)
|
||||
return <Camera ref={camera} {...cameraProps} />
|
||||
}
|
||||
```
|
||||
|
||||
@ -94,11 +89,6 @@ function App() {
|
||||
}
|
||||
}, [camera]);
|
||||
|
||||
return (
|
||||
<Camera
|
||||
style={StyleSheet.absoluteFill}
|
||||
ref={camera}
|
||||
/>
|
||||
)
|
||||
return <Camera ref={camera} {...cameraProps} />
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user