mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
fix(android/iOS): Fixed react-native 0.58 warnings (#311)
This commit is contained in:
@@ -194,10 +194,12 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
);
|
||||
}
|
||||
|
||||
getCommands = () => UIManager.getViewManagerConfig('RNCWebView').Commands;
|
||||
|
||||
goForward = () => {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.goForward,
|
||||
this.getCommands().goForward,
|
||||
null,
|
||||
);
|
||||
};
|
||||
@@ -205,7 +207,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
goBack = () => {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.goBack,
|
||||
this.getCommands().goBack,
|
||||
null,
|
||||
);
|
||||
};
|
||||
@@ -216,7 +218,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
});
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.reload,
|
||||
this.getCommands().reload,
|
||||
null,
|
||||
);
|
||||
};
|
||||
@@ -224,7 +226,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
stopLoading = () => {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.stopLoading,
|
||||
this.getCommands().stopLoading,
|
||||
null,
|
||||
);
|
||||
};
|
||||
@@ -232,7 +234,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
postMessage = (data: string) => {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.postMessage,
|
||||
this.getCommands().postMessage,
|
||||
[String(data)],
|
||||
);
|
||||
};
|
||||
@@ -246,7 +248,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
injectJavaScript = (data: string) => {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.injectJavaScript,
|
||||
this.getCommands().injectJavaScript,
|
||||
[data],
|
||||
);
|
||||
};
|
||||
@@ -311,7 +313,7 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
if (shouldStart) {
|
||||
UIManager.dispatchViewManagerCommand(
|
||||
this.getWebViewHandle(),
|
||||
UIManager.RNCWebView.Commands.loadUrl,
|
||||
this.getCommands().loadUrl,
|
||||
[String(url)],
|
||||
);
|
||||
}
|
||||
|
||||
+4
-7
@@ -289,13 +289,10 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
||||
);
|
||||
}
|
||||
|
||||
_getCommands() {
|
||||
if (!this.props.useWebKit) {
|
||||
return UIManager.RNCUIWebView.Commands;
|
||||
}
|
||||
|
||||
return UIManager.RNCWKWebView.Commands;
|
||||
}
|
||||
_getCommands = () =>
|
||||
!this.props.useWebKit
|
||||
? UIManager.getViewManagerConfig('RNCUIWebView').Commands
|
||||
: UIManager.getViewManagerConfig('RNCWKWebView').Commands;
|
||||
|
||||
/**
|
||||
* Go forward one page in the web view's history.
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
"flow-bin": "^0.80.0",
|
||||
"jest": "^24.0.0",
|
||||
"metro-react-native-babel-preset": "^0.51.1",
|
||||
"react-native": "^0.57",
|
||||
"react-native": ">=0.57 <0.59",
|
||||
"semantic-release": "15.10.3"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user