React Native Examples
Working code for each barKoder feature on React Native. Start with the general example, then add what your app needs.
Start here General example A complete scanner screen: the license key, the barcode types to read, the settings and the result.setBarcodeTypeEnabled Open the example →
import React, { useState } from 'react';
import { SafeAreaView, View, Text, Button, StyleSheet, Image, Alert } from 'react-native';
import { Barkoder, BarkoderView } from 'barkoder-react-native';
type ScanResult = {
textualData: string;
type: string;
thumbnailImage: string | null;
};
const BarcodeScanner = () => {
const [barkoder, setBarkoder] = useState<Barkoder | null>(null);
const [scannedResult, setScannedResult] = useState<ScanResult | null>(null);
const [isScanning, setIsScanning] = useState(false);