When the webview loads an invalid url, which property should I set to display an error view? I try renderError, it triggers the console message but did not display the view.
here's the code:
<View style={styles.webview_body}>
<WebView
source={{uri:this.props.url}}
onNavigationStateChange={this.onNavigationStateChange.bind(this)}
renderError={this.loadError.bind(this)}
/>
</View>
//the fucntion which display the error message
loadError(){
console.log('loaded');
return (
<View>
<Text>
something goes wrong.
</Text>
</View>
)
}
here's the screenshots
[Update] As I reload to clear the error, there's a temporary state which display the error view.