在WebView中单击某个链接时不调用onNavigationStateChange。以下是代码段:
_onNavigationStateChange(navState) {
console.log('_onNavigationStateChangeevent:',navState);
}
render() {
return(
<WebView
style={{
flex:1,
marginTop:20
}}
ref={WEBVIEW_REF}
source={{uri: 'https://www.tumblr.com/explore/text'}}
scalesPageToFit={true}
contentInset={{bottom:44}}
onLoadStart={this._onLoadStart.bind(this)}
onLoad={this._onLoadEnd.bind(this)}
onNavigationStateChange={this._onNavigationStateChange.bind(this)}
onShouldStartLoadWithRequest={this._onShouldStartLoadWithRequest}
startInLoadingState={true}
javaScriptEnabled={true}
domStorageEnabled={true}
/>
);
}
细节: https://github.com/facebook/react-native/issues/7602
如果未调用onNavigationStateChange方法,如何知道navState?