Camera flickering when changing state

I’m using SDK 34 with the latest android expo client.

I’m having an issue when intermittently the camera causes heavy flickering when it’s being unmounted. This only lasts about half a second but the flickering could possibly be dangerous with someone who suffers from epilepsy.

My code inside render() looks like this

if(scanning){
    return <Camera
               onBarCodeScanned={this.barcodeScanned}
               style={styles.scanner}
               barCodeScannerSettings={{
                   barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
                }}
            >
            </Camera>
} else {
    return <View></View>

The flickering happens roughly half the time. I have a button with absolute position that I use to toggle whether the camera is turned on or not.

Anyone have any ideas what could be causing this?

Hi

Could you make a minimal snack that reproduces the problem?

Off hand I don’t see why it would do that based on the code you posted.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.