How to use props flashmode?

Camera - Expo Documentation. In my BarCodeScanner, there is a button that can turn on/ turn off flash. But after update SDK to 3.3 that flash doesn’t work again.
How to solve it?


Could you post the code you’re using?

export default class BarCodeScreen extends React.Component {
constructor(props) {
this.state = {
flash: ‘off’
render() {
return (

style={[StyleSheet.absoluteFill, styles.container]}

hitSlop={{ top: 40, bottom: 40, right: 40, left: 40 }}>



_handleFlash = () => {
    if (this.state.flash == 'on') {
        this.setState({ flash: 'off' })
    } else {
        this.setState({ flash: 'on' })


Does setting it to ‘torch’ instead of ‘on’ help?

no,it doesn’t

Hey there, does react-native-torch work in expo? If not, is there a way to just use the flashlight without using the camera?

@acvaran I would also like to know

1 Like

Unfortunately there isn’t any library that uses the torch function and the way I have solved this problem was to use the expo-camera library. I am rendering the rest of the component inside of the Camera such as:
<Camera…><View style…/View>…/Camera>

And on the props of the Camera I am assigning the flashMode to a variable in the state so whenever I use setState it renders the Camera and opens the torch.

Hello, did you manage to make it work?
I really need the flashlight

is there any news…

expo-camera supports flash mode try it out

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.