Camera got open fine at the first time, Then when i leave the page and comes back, I see blank screen.
Some suggestions says to shutdown the camera when goes back and then when you come back to camera page it will reinitialised itself. But the deepARRef1 does not contain shutdown function to call.
Here is the code i am using
import React, { useEffect, useRef } from 'react';
import { TouchableOpacity } from 'react-native';
import { View } from 'react-native';
import { Text } from 'react-native';
import DeepARView from 'react-native-deepar';
Camera got open fine at the first time, Then when i leave the page and comes back, I see blank screen. Some suggestions says to shutdown the camera when goes back and then when you come back to camera page it will reinitialised itself. But the deepARRef1 does not contain shutdown function to call. Here is the code i am using
import React, { useEffect, useRef } from 'react'; import { TouchableOpacity } from 'react-native'; import { View } from 'react-native'; import { Text } from 'react-native'; import DeepARView from 'react-native-deepar';
const DeepARWrapper = (props) => { const deepARRef1 = useRef(null);
return ( <View style={{ flex: 1 }}> <TouchableOpacity style={{ position: 'absolute', top: 70, left: 20, zIndex: 33333, flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }} onPress={()=>{ deepARRef1.current.shutdown(); // tried to call here
); };
export default DeepARWrapper;