'How to turn off 'expo-barcode-scanner' completely upon scan?

I've found a couple of similar questions to this one, but it seems people are just disabling the render, which doesn't actually turn off the camera and leads to high power consumption. I want to completely turn off the camera after a QR code scan.

If anyone knows how to do this could you write up a quick example that just has a button that completely turns off and on the camera associated with expo-barcode-scanner? I don't have issues catching the barcode scan event.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source