-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to stop the camera when route chaned (help!!!!) #287
Comments
adding ReactDOM.unmountComponentAtNode(QrReader) works for me, hope it will work for you guys as well ` const Test = (props) => { return (
); |
nope, I also have the same problem, then I tried your method but i can see the component is gone but the camera is still on |
is there any solution? |
Here there is some temporary library #279 (comment) I hope this can solve your problem |
Thanks but it isnt working... |
ok then 😂, i know its not a good idea it can destroy the UX but for me instead of burning my camera because it keep running in the background, |
I cant do that. i will erase all my data which was stored before scanning. Anyway, thank a lot @isneverdead |
no problem, maybe you can store the data first to the local storage? yea i know it will a lot of work, but if you have any other library that working please let me know 🙂 |
I have the same problem in my localhost, although when I send to production this inconvenience does not happen and it works correctly. |
Me too, localhost it does not stop fire the event if it had a result, even if the qr code area is not displayed any more because of a true/false value for showing the camera image. |
You can stop the video track while the component is unmounting - the useEffect also ensures the video track isn't stopped upon first render of the component. See the following PR for details #357 |
Upon unmounting of the QrReader component, the video track will now be stopped.
I removed <React.StrictMode> and it worked. |
No description provided.
The text was updated successfully, but these errors were encountered: