yudielcurbelo / react-qr-scanner

A library to scan QR Codes in react.
https://yudielcurbelo.github.io/react-qr-scanner/
MIT License
223 stars 31 forks source link

useDeviceList() throws error when no cameras are available #40

Closed MarcoWel closed 4 months ago

MarcoWel commented 5 months ago

On a computer without cameras, the line const cameraDevices = useDeviceList(); causes an uncaught runtime error "Requested device not found". IMO this should just create an empty array [].

yudielcurbelo commented 4 months ago

Please try this beta 2.0.0-beta.8. There are breaking changes for this beta release.

yudielcurbelo commented 4 months ago

This issue is fixed on new hook useDevices.