Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
React native Barcode scanner getting black screen and camera not working

I'm trying to integrate barcode scanner in my app, i installed barcode library and did all the setup. When i run the app, camera is not opening. It getting black screen.

Pls help me out of it enter image description here

 import {View, Text, StyleSheet, TouchableOpacity, FlatList} from 'react-native';
import React from 'react';
import HeaderMain from '../../../button/Header';
import Backnavigation from '../../../button/backbutton';
// @ts-ignore
import BarcodeScanner from 'react-native-scan-barcode';



const Addbook = ({navigation}:any) => {
  const [torchMode, setTorchMode] = React.useState<string>('off');
  const [cameraType, setCameraType] = React.useState<string>('back');

  const barcodeReceived = (e:any) => {
    console.log('Barcode: ' + e.data);
    console.log('Type: ' + e.type);
  };
  return (
    <View style={{flex: 1}}>
      
      <BarcodeScanner
        onBarCodeRead={barcodeReceived}
        style={{ flex: 1 }}
        torchMode={torchMode}
        cameraType={cameraType}
      />
      
    </View>
  );
};

export default Addbook;

const styles = StyleSheet.create({
  listHeader: {
    width: '90%',
    alignSelf: 'center',
    backgroundColor: '#fff',
    height: 50,
    marginTop: 10,
    justifyContent: 'center',
  },
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!