Description:
I’m trying to implement the screen below. The red border should only show when the camera is recording, but this crashes the phone on Android.
I think the problem is that if state changes, the camera needs to re-render (i.e. this.state.isRecording
changes to true
). Meanwhile this.camera.recordAsync
is being called and it crashes the phone since the camera ref
also changes and so trying to start a recording on a camera that has been unmounted causes the device to crash.
I even tried to use the setState
second param callback, but this doesn’t work either and the screen just goes black.
Re-produce:
Click record on the snack below on an Android device.
Snack:
See functions record1
and record2
, and containerStyles
inside the render
function.