I am using react native camera with child functions as shown or the docs (https://github.com/react-native-community/react-native-camera/blob/master/docs/RNCamera.md). When I try first try to use the camera it shows the permission view which works as it is. But after the first use every time I want to use the camera, the app flashes quickly the permission view even though the status is 'READY'. I figured it out the issue is that RNCamera brings camera and status information but the status value is updated after the component is mounted.
The value jumps from 'PENDIN AUTHORIZATION' to 'READY' and that's why it flashes the authorization view. Is there any workaround this so that the first time I use the camera works as expected and then in another use the camera doesn't show the authorization view but the camera itself? Thanks in advance
<RNCamera>
{({ camera, status }) => {
if (status === 'READY'){
return ( <View>.....Camera.... </View>
)
}
else if (status !== 'READY'){
return (<CameraPermission/>)
}
}}
</RNCamera>