react native library for scanning qrcode/barcode from image
npm install rn-qr-barcode-image-scan
or
yarn add rn-qr-barcode-image-scan
import { scanFromPath } from 'rn-qr-barcode-image-scan';
import {
launchImageLibrary,
type ImageLibraryOptions,
} from 'react-native-image-picker';
// ...
const option: ImageLibraryOptions = {
mediaType: 'photo',
};
const result = await launchImageLibrary(option);
const uri = result?.assets?.[0]?.uri;
if (!uri) {
return;
}
//codes: string[]
const codes = await scanFromPath(uri);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library