Expo BarCodeScanner freezes (better said, the camera) when leaving the app

Please provide the following:

  1. SDK Version: 37
  2. Platforms: Android/iOS

I have this BarCodeScanner from Expo placed in a tab:

return (
        flex: 1,
        flexDirection: "column",
        justifyContent: "flex-end",
        onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}

      {scanned && (
        <Button title={"Tap to Scan Again"} onPress={() => setScanned(false)} />

When scanned, I’m redirecting to a page like so:

  const handleBarCodeScanned = ({ type, data }) => {
    props.navigation.navigate("EanProduct", {
      ean: data,

It works fine. The problem is, when I leave the app via Homebutton and go back into the app, the camera is frozen. The app has not crashed, I can navigate around, but the camera is frozen.

Is there a work-around to wake the camera back up? Or why is this happening at all? I tried to listen to navigation changes to reload the screen with didFocus for the tabbar

  useEffect(() => {
    const navFocusListener = props.navigation.addListener("didFocus", () => {

    return () => {
  }, [props.navigation]);

Unfortunately this does not work. The camera stays frozen.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.