diff options
-rw-r--r-- | src/components/BarcodeScanner.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/BarcodeScanner.js b/src/components/BarcodeScanner.js index 73ae19a..1572062 100644 --- a/src/components/BarcodeScanner.js +++ b/src/components/BarcodeScanner.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { View, Text, Button, Alert } from 'react-native'; -import { BarCodeScanner } from 'expo-barcode-scanner'; +import { CameraView, Camera } from 'expo-camera' const BarcodeScanner = ({ onScan }) => { const [hasPermission, setHasPermission] = useState(null); @@ -8,7 +8,7 @@ const BarcodeScanner = ({ onScan }) => { useEffect(() => { (async () => { - const { status } = await BarCodeScanner.requestPermissionsAsync(); + const { status } = await Camera.requestCameraPermissionsAsync(); setHasPermission(status === 'granted'); })(); }, []); @@ -38,7 +38,7 @@ const BarcodeScanner = ({ onScan }) => { return ( <View style={{ flex: 1 }}> - <BarCodeScanner + <CameraView onBarCodeScanned={scanned ? undefined : handleBarCodeScanned} style={{ flex: 1 }} /> |