|
@@ -194,10 +194,19 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
194
|
194
|
);
|
195
|
195
|
}
|
196
|
196
|
|
|
197
|
+ getViewManagerConfig = (viewManagerName: string) => {
|
|
198
|
+ if (!UIManager.getViewManagerConfig) {
|
|
199
|
+ return UIManager[viewManagerName];
|
|
200
|
+ }
|
|
201
|
+ return UIManager.getViewManagerConfig(viewManagerName);
|
|
202
|
+ };
|
|
203
|
+
|
|
204
|
+ getCommands = () => this.getViewManagerConfig('RNCWebView').Commands;
|
|
205
|
+
|
197
|
206
|
goForward = () => {
|
198
|
207
|
UIManager.dispatchViewManagerCommand(
|
199
|
208
|
this.getWebViewHandle(),
|
200
|
|
- UIManager.RNCWebView.Commands.goForward,
|
|
209
|
+ this.getCommands().goForward,
|
201
|
210
|
null,
|
202
|
211
|
);
|
203
|
212
|
};
|
|
@@ -205,7 +214,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
205
|
214
|
goBack = () => {
|
206
|
215
|
UIManager.dispatchViewManagerCommand(
|
207
|
216
|
this.getWebViewHandle(),
|
208
|
|
- UIManager.RNCWebView.Commands.goBack,
|
|
217
|
+ this.getCommands().goBack,
|
209
|
218
|
null,
|
210
|
219
|
);
|
211
|
220
|
};
|
|
@@ -216,7 +225,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
216
|
225
|
});
|
217
|
226
|
UIManager.dispatchViewManagerCommand(
|
218
|
227
|
this.getWebViewHandle(),
|
219
|
|
- UIManager.RNCWebView.Commands.reload,
|
|
228
|
+ this.getCommands().reload,
|
220
|
229
|
null,
|
221
|
230
|
);
|
222
|
231
|
};
|
|
@@ -224,7 +233,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
224
|
233
|
stopLoading = () => {
|
225
|
234
|
UIManager.dispatchViewManagerCommand(
|
226
|
235
|
this.getWebViewHandle(),
|
227
|
|
- UIManager.RNCWebView.Commands.stopLoading,
|
|
236
|
+ this.getCommands().stopLoading,
|
228
|
237
|
null,
|
229
|
238
|
);
|
230
|
239
|
};
|
|
@@ -232,7 +241,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
232
|
241
|
postMessage = (data: string) => {
|
233
|
242
|
UIManager.dispatchViewManagerCommand(
|
234
|
243
|
this.getWebViewHandle(),
|
235
|
|
- UIManager.RNCWebView.Commands.postMessage,
|
|
244
|
+ this.getCommands().postMessage,
|
236
|
245
|
[String(data)],
|
237
|
246
|
);
|
238
|
247
|
};
|
|
@@ -246,7 +255,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
246
|
255
|
injectJavaScript = (data: string) => {
|
247
|
256
|
UIManager.dispatchViewManagerCommand(
|
248
|
257
|
this.getWebViewHandle(),
|
249
|
|
- UIManager.RNCWebView.Commands.injectJavaScript,
|
|
258
|
+ this.getCommands().injectJavaScript,
|
250
|
259
|
[data],
|
251
|
260
|
);
|
252
|
261
|
};
|
|
@@ -311,7 +320,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
311
|
320
|
if (shouldStart) {
|
312
|
321
|
UIManager.dispatchViewManagerCommand(
|
313
|
322
|
this.getWebViewHandle(),
|
314
|
|
- UIManager.RNCWebView.Commands.loadUrl,
|
|
323
|
+ this.getCommands().loadUrl,
|
315
|
324
|
[String(url)],
|
316
|
325
|
);
|
317
|
326
|
}
|