I have a function to take a photo with android, with Expo-Image-Picker. I save the result in a local state pickedUri, then sending it to Redux state through dispatch. The first time I get pickedUri as undefined, but the second time it saves the first photo taken. I think the problem is the async function.
const handlerTakeImage = async () => {
const isCameraOk = await verifyPermissions();
if (!isCameraOk) return;
const image = await ImagePicker.launchCameraAsync({
allowsEditing: true,
aspect: [16, 9],
quality: 0.8,
});
setPickedUri(image.uri);
console.log(pickedUri);
pickedUri && dispatch(saveImage(pickedUri, props.itemId));
};