i am trying to change flash mode on expo camera but it's not working and i can't find any documentation for that, here is some code snippets: -the hook i am using for the flash mode:
const [flash, setFlash] = useState(Camera.Constants.FlashMode.off);
-and here is the function i am using:
<TouchableWithoutFeedback style={styles.flash}
onPress={() => {
setFlash(
flash === Camera.Constants.FlashMode.off
? Camera.Constants.FlashMode.torch
: Camera.Constants.FlashMode.off);
}}>
<MaterialCommunityIcons
style={styles.flash}
name="flash"
color={"#9c1937"}
size={50}
/>
</TouchableWithoutFeedback>
i cant change the flash mode using this (def: off), however changing front and back cameras is achieved using exactly the same way so please help, (i am using functional components).