- SDK Version: 41
- Platforms(Android/iOS/web/all): all
I have a tab that opens the Barcode Scanner component. When the scan is complete and successful, I use React Navigation to navigate to another tab. Meanwhile, the camera is still running and causing the phone to overheat. How can I “disable” the camera when on other tabs?
I’m using React navigation v4 and Redux (Toolkit) for state management. The
onNavigationStateChange property helps me detect when the tab changes, which I then use to store a boolean to indicate whether or not to show the Scanner component on the Barcode Scanner screen.
Currently, the scanner does not appear on the screen despite the fact that the camera is on as soon as I switch to the Barcode Scanner tab / screen and until the Expo app is killed.