I have a WebView which i set the the onError and the onLoadEnd.
The problem is that when i have a web page which returns a 404 not found error, i don't get it in the onError handler. I do get the onLoadEnd but there is no way to know that this is a 404 except the title.

Is there a way to detect that?
I was expecting that this would be handled by the onError callback.
With the current version of react-native-webview, code is a property on the event. Make sure your web server is indeed returning an HTTP code 404, and not just a webpage that says 404 in the title.
<WebView
source={{ uri: 'https://philihp.com/it-is-a-404' }}
onError={({ code }) => {
console.log({ code });
}}
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With