react-native-webview
Advanced tools
Comparing version 1.0.3 to 1.0.4
22
index.js
@@ -7,4 +7,2 @@ var React = require('react-native'); | ||
var NativeWebView = requireNativeComponent('RCTWebView',WebView); | ||
var WEBVIEW_REF = 'webview'; | ||
@@ -20,6 +18,15 @@ | ||
javaScriptEnabledAndroid: PropTypes.bool, | ||
onNavigationStateChange: PropTypes.func | ||
}, | ||
_onNavigationStateChange: function(event){ | ||
if(this.props.onNavigationStateChange){ | ||
this.props.onNavigationStateChange(event.nativeEvent); | ||
} | ||
}, | ||
_getWebViewHandle: function(){ | ||
return React.findNodeHandle(this.refs[WEBVIEW_REF]); | ||
}, | ||
goBack: function(){ | ||
UIManager.dispatchViewManagerCommand( | ||
React.findNodeHandle(this.refs.webview), | ||
_getWebViewHandle, | ||
UIManager.RCTWebView.Commands.goBack, | ||
@@ -31,3 +38,3 @@ null, | ||
UIManager.dispatchViewManagerCommand( | ||
React.findNodeHandle(this.refs.webview), | ||
_getWebViewHandle, | ||
UIManager.RCTWebView.Commands.goForward, | ||
@@ -39,3 +46,3 @@ null, | ||
UIManager.dispatchViewManagerCommand( | ||
React.findNodeHandle(this.refs.webview), | ||
_getWebViewHandle, | ||
UIManager.RCTWebView.Commands.reload, | ||
@@ -48,4 +55,5 @@ null, | ||
<NativeWebView | ||
ref={WEBVIEW_REF} | ||
{...this.props} | ||
ref={WEBVIEW_REF} | ||
onNavigationStateChange={this._onNavigationStateChange} | ||
/> | ||
@@ -56,2 +64,4 @@ ); | ||
var NativeWebView = requireNativeComponent('RCTWebView',WebView); | ||
module.exports = WebView; |
{ | ||
"name": "react-native-webview", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "andorid webview for react-native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13174
10
54