From 3b6a18902ee9c4970dbcc5a2d8d111256a0b3736 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 17 Oct 2024 20:07:18 +0530 Subject: Replaced the BarcodeScanner module from expo-barcode-scanner to expo-camera --- src/components/BarcodeScanner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 ( - -- cgit v1.2.3-59-g8ed1b