Implement onLoading(Start|Finish|Error) and injectedJavaScript props

Summary:
@public

This diff includes four very straightforward changes:
1. Whenever the WebView starts loading, the `onLoadingStart` hook should be executed. The event passed into this hook should be decorated with the `navigationType`.
1. Whenever the WebView errors out while loading, the `onLoadingError` hook should be executed.
1. Whenever the WebView finishes loading (without any errors), the `onLoadingFinish` hook should be executed.
1. The serialized JavaScript passed into the `injectedJavaScript` prop should be executed when the WebView finishes loading. After execution finishes, the `onLoadingFinish` prop should be called with the serialized completion value of this JavaScript.

Reviewed By: shergin

Differential Revision: D6293532

fbshipit-source-id: 21407c766f73413046823ae605afc21e85cf9db6
This commit is contained in:
Ramanpreet Nara
2018-08-16 13:33:55 -07:00
committed by Facebook Github Bot
parent 1442c265da
commit 3703927e7e
3 changed files with 126 additions and 2 deletions

View File

@@ -18,5 +18,6 @@
@property (nonatomic, weak) id<RCTWKWebViewDelegate> delegate;
@property (nonatomic, copy) NSDictionary *source;
@property (nonatomic, copy) NSString *injectedJavaScript;
@end