0

I'm very new to React Native and working at modifying an app that was built for me. I have fixed an issue with camera ratio looking squashed on the screen, however now I'm getting an unhandled promise rejection error. Previously, this would start recording:

const startRecording = async () => {
    setRecording(true);
    camera.current;
    const response = await camera.current.recordAsync(

However now it's saying Undefined is not an object( evaluating 'camera.current.recordAsync' startRecording$)

I assume it's because previously the camera was being defined as const camera = useRef(); whereas the ratio fix (from here) is using const [camera, setCamera] = useState(null); but I'm not sure on how to correct it.

BN83
  • 902
  • 3
  • 9
  • 29

1 Answers1

0

Found the answer. Probably quite basic, said I'm a noob!

useState() doesn't have the .current property. Removed that and it works.

BN83
  • 902
  • 3
  • 9
  • 29