'React-native Vision Camera unable to zoom

I am unable to zoom in https://github.com/mrousavy/react-native-vision-camera on ios devices. I am able to zoom in on android devices without any problem but unable to zoom on iPhones or iPads can anyone help me.



Solution 1:[1]

import React, { useCallback, useEffect, useRef } from 'react';
import { Alert, FlatList, View } from 'react-native';
import { Camera, useCameraDevices } from 'react-native-vision-camera';


const SystemCamera = () => {

    const devices: any = useCameraDevices();
    const device = devices.back;

    const [isCameraInitialized, setIsCameraInitialized] = useState(false);

    let cameraRef: any = useRef<Camera>(null);

    const onCameraInitialized = useCallback(() => {
        setIsCameraInitialized(true);
    }, []);

    useEffect(() => {
        checkCameraPermission(componentId);
    }, []);


    if (device == null) return;
    return (
        <ThemeProvider
            children={
                <View style={{ flex: 1 }}>
                    <Camera
                        hdr={true}
                        photo={true}
                        ref={cameraRef}
                        isActive={true}
                        focusable={true}
                        enableZoomGesture={true}
                        device={device}
                        onInitialized={onCameraInitialized}
                    >
                        {children}
                    </Camera>
                </View>
            }
        />
    )
}

export default SystemCamera;

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 Shalini.g Bhousle