Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactImageView: Image source "null" doesn't exist React-native

I am making a react-native app to open the camera and scan barcodes/Qr codes, I'm using react-native-camera-kit and my project works fine, however, when I open the camera I get a warning log saying: ReactImageView: Image source "null" doesn't exist, I don't know why this occurs, some suggest?

this is my code:

 <CameraScreen
        showFrame={true}
        // Show/hide scan frame
        scanBarcode={true}
        // Can restrict for the QR Code only
        laserColor={'red'}
        // Color can be of your choice
        frameColor={'red'}
        // If frame is visible then frame color
        colorForScannerFrame={'black'}
        // Scanner Frame color
        onReadCode={(event) =>
          onBarcodeScan(event.nativeEvent.codeStringValue)
        }
      />
like image 480
Antonio Rodríguez Avatar asked Jun 19 '26 22:06

Antonio Rodríguez


1 Answers

You should share the whole component code to figure out the issue but the comment problem that cause this when you use something like:

<Image source={{uri: **this.state.ImageURI**}} /> 

and the ImageURI from the state is not there yet. use a condition to fix it like:

{ this.state.ImageURI !== '' ? <Image source={this.state.ImageURI} /> :null
}
like image 188
Hosam G. Zewain Avatar answered Jun 23 '26 02:06

Hosam G. Zewain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!