react-qr-reader icon indicating copy to clipboard operation
react-qr-reader copied to clipboard

How to implement new ViewFinder - Instructions Unclear

Open ShiftyKitty opened this issue 2 years ago • 2 comments

Looking for ViewFinder to be implemented on QR code reader but docs don't adequately demonstrate how to use.

Previously showViewFinder accepted a Boolean value, which makes sense whether you want to switch on or off.

It is now a component but if used as such and attempt to import from "react-qr-reader" this does not work.

I see that in the working example, a function is passed into this but what information is needed exactly in the function to get this to work and overlay on the video?

Of course can implement my own custom CSS but it seems that this should not be necessary.

ShiftyKitty avatar Jul 07 '22 08:07 ShiftyKitty

image image

ViewFinder is a property of QrReader and you pass a component in it, inline like how I did in the screenshots or create a separated component file, place the code, then import and pass it to ViewFinder. ViewFinder will act as an overlay for the video and further you'll have to modify the css of the component (position: absolute, top: 0, left: 0 etc)

pinguluk avatar Jul 13 '22 15:07 pinguluk

Here I put the component into a file image image image

pinguluk avatar Jul 13 '22 16:07 pinguluk