onCapture = (error, snapshot) => { const { captureRequested } = this.state; if (error) console.error(error); else doSomethingWithSnapshot(snapshot); this.setState({ captureRequested: false }); }; render () { return <View> <Button onPress={() => this.setState({ captureRequested: true })}>CAPTURE</Button> <Text>...<Text> <Text>...<Text> <Text>...<Text> {!captureRequested ? null : <AutoCaptureGLThing {...whateverProps} onCapture={this.onCapture} />} </View>; }