Open theone3nu opened 5 years ago
I have the same problem, try this `import { RNCamera as Camera } from 'react-native-camera';
Camera.Constants.FlashMode.torch `
@yaibait thanks it works
import { RNCamera as Camera } from 'react-native-camera';
Camera.Constants.FlashMode.torch
I don't think the above is correct for the latest. flashMode no longer exists on QRCodeScanner by the looks instead it takes cameraProps.
This is the solution for me using latest
import QRCodeScanner from "react-native-qrcode-scanner";
import { RNCamera as Camera } from "react-native-camera";
<QRCodeScanner
onRead={onSuccess}
cameraProps={{ flashMode: Camera.Constants.FlashMode.auto }}
topContent={<Text style={styles.centerText}>Test</Text>}
bottomContent={
<TouchableOpacity style={styles.buttonTouchable}>
<Text style={styles.buttonText}>OK. Got it!</Text>
</TouchableOpacity>
}
/>
@moaazsidat why the constants it's no more available in QRCodeScanner? 🤔
@moaazsidat along #241 merged can we close this one?
Unable to detect constants from QRCodeScanner
What's happening?
when i add flashMode prop to the QRCodeScanner getting the above error
How can it be reproduced?
<QRCodeScanner onRead={this.onSuccess} flashMode={QRCodeScanner.Constants.FlashMode.torch} topContent={
Build details?
Android OS