Last active
January 4, 2018 23:48
-
-
Save zaguiini/42c0a45e68d4f14d695109229a2d6aa0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PureComponent } from 'react' | |
import { Platform, WebView as WebViewAndroid } from 'react-native' | |
import WebViewIOS from 'react-native-wkwebview-reborn' | |
const webviewRef = 'webview' | |
... | |
class App extends PureComponent { | |
... | |
webviewProps = { | |
ref: webviewRef, | |
onNavigationStateChange: this.handleNavigationStateChange.bind(this), | |
onMessage: this.handleMessage.bind(this), | |
javaScriptEnabled: true, | |
source: { | |
uri: 'https://yourloginurl.com', | |
} | |
} | |
render() { | |
return ( | |
Platform.OS === 'ios' ? | |
<WebViewIOS {...this.webviewProps} /> : | |
<WebViewAndroid {...this.webviewProps} /> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment