mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
fix(iOS/android getViewManagerConfig): Fix crash with react-native < 0.58
This commit is contained in:
@@ -194,7 +194,14 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommands = () => UIManager.getViewManagerConfig('RNCWebView').Commands;
|
getViewManagerConfig = viewManagerName => {
|
||||||
|
if (!UIManager.getViewManagerConfig) {
|
||||||
|
return UIManager[viewManagerName];
|
||||||
|
}
|
||||||
|
return UIManager.getViewManagerConfig(viewManagerName);
|
||||||
|
};
|
||||||
|
|
||||||
|
getCommands = () => this.getViewManagerConfig('RNCWebView').Commands;
|
||||||
|
|
||||||
goForward = () => {
|
goForward = () => {
|
||||||
UIManager.dispatchViewManagerCommand(
|
UIManager.dispatchViewManagerCommand(
|
||||||
|
|||||||
+9
-2
@@ -296,10 +296,17 @@ class WebView extends React.Component<WebViewSharedProps, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getViewManagerConfig = viewManagerName => {
|
||||||
|
if (!UIManager.getViewManagerConfig) {
|
||||||
|
return UIManager[viewManagerName];
|
||||||
|
}
|
||||||
|
return UIManager.getViewManagerConfig(viewManagerName);
|
||||||
|
};
|
||||||
|
|
||||||
_getCommands = () =>
|
_getCommands = () =>
|
||||||
!this.props.useWebKit
|
!this.props.useWebKit
|
||||||
? UIManager.getViewManagerConfig('RNCUIWebView').Commands
|
? this._getViewManagerConfig('RNCUIWebView').Commands
|
||||||
: UIManager.getViewManagerConfig('RNCWKWebView').Commands;
|
: this._getViewManagerConfig('RNCWKWebView').Commands;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Go forward one page in the web view's history.
|
* Go forward one page in the web view's history.
|
||||||
|
|||||||
Reference in New Issue
Block a user