QR Code Scanner
Usage
import QrCodeScanner from '@sensorfactdev/qr-code-scanner';
const handleScanResult = result => {
console.log(result);
// {
// "result": "RESULT STRING VALUE",
// "points": [
// {
// "x": 171,
// "y": 445,
// "count": 2,
// "estimatedModuleSize": 3.857142857142857
// },
// // .... more points
// ]
// }
}
const MyApp = () => (
<div>
<QrCodeScanner
onQrCodeScanned={handleScanResult}
width={window.innerWidth}
height={window.innerHeight}
showAimAssist // Defaults to true, disable to remove the aim assist
/>
</div>
)
Props
Key | Type | Default Value |
---|---|---|
onQrCodeScanned | Function | console.log |
width | Number | window.innerWidth |
height | Number | window.innerHeight |
Development
To start Storybook:
yarn start
To run the tests:
yarn test
To run tests in watch mode:
yarn test --watch
Building the module
yarn build