Because of Google Play, I had to update an old project of mine to the latest expo versions (version 43.0.0 to be exact). The idea is for the app to scan a QRCode and process the data, simply. However, expo-barcode-scanner only works once and after that I need to close and open the app again to work. Has anyone encountered this problem and (or) knows how to solve it? Below is my code:
{escaneando ? (
<BarCodeScanner
barCodeTypes={[
BarCodeScanner.Constants.BarCodeType.ean13,
BarCodeScanner.Constants.BarCodeType.ean8,
BarCodeScanner.Constants.BarCodeType.upc_a,
BarCodeScanner.Constants.BarCodeType.upc_e,
]}
onBarCodeScanned={this.handleBarCode.bind(this)}
style={[StyleSheet.absoluteFillObject, styles.barscan]}
/>
) : null}
And library specifications:
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^6.0.5",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"expo": "~43.0.0",
"expo-av": "^10.1.3",
"expo-barcode-scanner": "^11.1.2",
"expo-status-bar": "~1.1.0",
"lodash": "^4.17.21",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "^0.64.2",
"react-native-dropdownalert": "^4.3.0",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-in-app-notification": "^3.2.0",
"react-native-offline": "^6.0.0",
"react-native-paper": "^4.10.0",
"react-native-reanimated": "^2.2.3",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.9.0",
"react-native-web": "0.17.1",
"react-navigation": "^4.4.4",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-thunk": "^2.4.0",
"reselect": "^4.1.2"