How can I implement a Web barcode scanner in React to work in browser (desktop/mobile)?

Viewed 3805

I would like to have a camera view, which uses device's camera and detects barcodes' data. How can it be done in a React app?

Not for React Native. It has to work both on desktop and mobile using browser.

1 Answers

As long as you use a barcode library implemented in JavaScript, you can make your web apps work on both desktop and mobile.

I've written an article - How to Build Web Barcode Scanner Using React and Webcam which shows you how to build such an app from scratch using Dynamsoft JavaScript Barcode SDK.

Dynamsoft JavaScript Barcode SDK is commercial software. If you want to use open-source SDK for free, you can use ZXing as the substitution.

Here is the source code:

https://github.com/yushulx/zxing-cpp-emscripten

Related