I'm rendering a logo in the middle of the QR Code via require('./logo.png'). The QR code appears on a receipt layout, which is captured as an image via react-native-view-shot se we can either email it and/or send to a printer. This works great, however there is a race condition between capturing the screen shot and loading the logo image. I've been hunting for something like <Image/>'s onLoad event handler, and have also tried using Image.prefetch() without much success—perhaps because it's a local image?
Is there any way to know when the image is done loading or prefetch the image so that it renders on first pass when using your image component? I'd be happy to submit a PR to react-native-qrcode-svg, assuming we'd need to make the underlying API available.
Hi all!
I'm using react-native-qrcode-svg, which uses this package under the hood.
I'm rendering a logo in the middle of the QR Code via
require('./logo.png')
. The QR code appears on a receipt layout, which is captured as an image viareact-native-view-shot
se we can either email it and/or send to a printer. This works great, however there is a race condition between capturing the screen shot and loading the logo image. I've been hunting for something like<Image/>
'sonLoad
event handler, and have also tried usingImage.prefetch()
without much success—perhaps because it's a local image?Is there any way to know when the image is done loading or prefetch the image so that it renders on first pass when using your image component? I'd be happy to submit a PR to
react-native-qrcode-svg
, assuming we'd need to make the underlying API available.Thanks!