diff --git a/WKWebView.ios.js b/WKWebView.ios.js index a24024a2..a60340b1 100644 --- a/WKWebView.ios.js +++ b/WKWebView.ios.js @@ -385,7 +385,7 @@ class WKWebView extends React.Component { goForward = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.CRAWKWebView.Commands.goForward, + this.getCRAWKWebView().Commands.goForward, null ); }; @@ -396,7 +396,7 @@ class WKWebView extends React.Component { goBack = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.CRAWKWebView.Commands.goBack, + this.getCRAWKWebView().Commands.goBack, null ); }; @@ -422,7 +422,7 @@ class WKWebView extends React.Component { this.setState({ viewState: WebViewState.LOADING }); UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.CRAWKWebView.Commands.reload, + this.getCRAWKWebView().Commands.reload, null ); }; @@ -433,7 +433,7 @@ class WKWebView extends React.Component { stopLoading = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.CRAWKWebView.Commands.stopLoading, + this.getCRAWKWebView().Commands.stopLoading, null ) }; @@ -451,7 +451,7 @@ class WKWebView extends React.Component { postMessage = (data) => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.CRAWKWebView.Commands.postMessage, + this.getCRAWKWebView().Commands.postMessage, [String(data)] ); }; @@ -470,6 +470,14 @@ class WKWebView extends React.Component { } }; + getCRAWKWebView = () => { + return ( + UIManager.getViewManagerConfig ? + UIManager.getViewManagerConfig('CRAWKWebView') : + UIManager.CRAWKWebView + ); + }; + /** * Returns the native webview node. */