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

Improve useEffect: include dependencies and introduce additional effect which stops scanner when component unmounts

Open spaudanjo opened this issue 3 years ago • 0 comments

Current behavior

Updating properties (e.g. constraints) currently doesn't make the scanner behaviour adapt/reflect these updates. This is because these properties are not in the dependencies array of the useEffect within hooks.ts.

Proposal

Adding the missing dependencies to the useEffect and introducing an additional useEffect` which exclusively does the scanner stopping when the component unmounts.

spaudanjo avatar Jun 09 '22 09:06 spaudanjo