I am trying to take a photo using react native camera immediately after changing from back to front camera. To give you an idea, the code looks kind of like this:
state = {
type: Camera.Constants.Type.back
}
takePicture = () => {
const options = {quality:0.5}
this.setState({type:Camera.Constants.Type.front}, () => {
this.camera.takePictureAsync(options).then(data => {
console.log(data)
});
})
};
I presumed that the photo I would have taken would be the one with the front facing camera. However, the photo i get is always the one with the back facing camera. Is there something im missing?