This fixes setting the input value on scan if the component remounts while the scanner is open. No need to use useRef to close the scanner on remount.
This fixes setting the input value on scan if the component remounts while the scanner is open. No need to use useRef to close the scanner on remount.