79641594

Date: 2025-05-28 06:15:25
Score: 2
Natty:
Report link

I have found this lib which solves my problem: https://github.com/iliapnmrv/react-native-urovo

The code im using to capture a scanned barcode:

useEffect(() => {

    let eventListener
    if (Urovo) { // used only for type safety
      const eventEmitter = new NativeEventEmitter(Urovo);
      eventListener = eventEmitter.addListener(
        UROVO_EVENTS.ON_SCAN,
        (scan) => {
          props.onScan(scan.value)

        }
      );
    }

    return () => {
      eventListener?.remove();
    };
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Marco Lembert