react-native-macos/React
Jonathan Ballerano 9923d3fa6f Use `loadRequest` instead of `reload` when initial load fails
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
2016-04-08 17:17:23 -07:00
..
Base make `RCTEventDispatcher` dispatch events in incoming order 2016-04-05 09:17:28 -07:00
Executors Avoid crashing when executor is invalidated before it finishes loading RA Bundle 2016-04-08 07:34:28 -07:00
Layout Import css-layout measure mode changes from pull request #163 2016-04-07 10:16:30 -07:00
Modules Added support for JavaScript third-party debuggers 2016-04-07 13:15:58 -07:00
Profiler Use indirect jumps on armv7 2016-04-04 06:49:19 -07:00
React.xcodeproj Fix OSS project configuration 2016-03-30 03:12:27 -07:00
Views Use `loadRequest` instead of `reload` when initial load fails 2016-04-08 17:17:23 -07:00