mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 04:24:15 +00:00
9923d3fa6f
Summary:On iOS, `WebView` will get stuck when the first request fails to load. The most common case where this could happen is when a user has limited or no connectivity. Here's a repo with a sample app that demonstrates the problem and this fix: [https://github.com/jballer/react-native-webview-reload-example](https://github.com/jballer/react-native-webview-reload-example). **Attempted workarounds** - `WebView.reload()` fails internally because the `UIWebView`'s `currentRequest` doesn't have its `URL` set - Setting `WebView.source.uri` won't do anything; the JS value value is unchanged and therefore doesn't cross the native bridge. - Unmounting and remounting the `WebView` component would lose history and context if an error occurs on a request that's not the first request. **Test plan (manual testing)** 1. Disable network connection 1. Relaunch application or reload JS 1. Enable network connection 1. Tap "reload" button 1. Observe whether page reloads Closes https://github.com/facebook/react-native/pull/6873 Differential Revision: D3159219 Pulled By: javache fb-gh-sync-id: 8893dd20dc9f4a1a00d14a488ce657cc50287a29 fbshipit-source-id: 8893dd20dc9f4a1a00d14a488ce657cc50287a29