mirror of
https://github.com/expo/react-native-webview.git
synced 2026-11-15 09:18:06 -10:00
fix(iOS/android getViewManagerConfig): Fix crash with react-native < 0.58
This commit is contained in:
1 parent
a4c6f210cf
commit
263fc5ec3c
2 files changed
+17
-3
No files matched your search
@@ -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 = () => {
|
||||
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 = () =>
|
||||
!this.props.useWebKit
|
||||
? UIManager.getViewManagerConfig('RNCUIWebView').Commands
|
||||
: UIManager.getViewManagerConfig('RNCWKWebView').Commands;
|
||||
? this._getViewManagerConfig('RNCUIWebView').Commands
|
||||
: this._getViewManagerConfig('RNCWKWebView').Commands;
|
||||
|
||||
/**
|
||||
* Go forward one page in the web view's history.
|
||||
|
||||
Reference in new issue
Block a user