moaazsidat / react-native-qrcode-scanner

A QR code scanner component for React Native.
MIT License
2.04k stars 516 forks source link

qrcodeScannerRef.current.reactivate() does not woking #376

Open chukiatt opened 2 years ago

chukiatt commented 2 years ago

const PosBarcodeScan = React.forwardRef(({ onBarcodeScanned, onDismiss }, ref) => { // /* call from outer with {ref} / useImperativeHandle(ref, () => ({ reactivate: () => { qrcodeScannerRef.current.reactivate(); }, }));

})

What's happening?

qrcodeScannerRef.current.reactivate()

How can it be reproduced?

Build details?

moaazsidat commented 2 years ago

Will accept PRs fixing the issue, thanks!

markl-vesper commented 2 years ago

I'm wondering if this could the cause of an issue I am seeing

QRScanner is working fine for the 1st scan. User then moves onto other screens. If the user needs to perform a new scan but has NOT restarted the app then all they get is a white screen when the app navigates back to the screen that renders the QRSCanner. If app has been restarted then the QRScanner works perfectly