Skip to content

Instantly share code, notes, and snippets.

@medic-code
Last active November 1, 2020 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medic-code/44cb5223d268e5508be0c80f656aa887 to your computer and use it in GitHub Desktop.
Save medic-code/44cb5223d268e5508be0c80f656aa887 to your computer and use it in GitHub Desktop.
/*export default class App extends Component {
state = {
webview: false,
url: ''
}
onSuccess = e => {
this.setState({url: e.data, webview: true})
}; */
render() {
return (
<View style={{flex:1}}>
{this.state.webview && (<WebView
source={{uri: this.state.url}}
style={{flex:1}}
scalesPageToFit={true} />
)}
{!this.state.webview && (<QRCodeScanner
onRead={this.onSuccess.bind(this)}
reactivate={true}
reactivateTimeout={4000}/>
)}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment