From b5dfd4392924caa4f436abacfd029debee6944ec Mon Sep 17 00:00:00 2001 From: Amsul Date: Thu, 8 Dec 2016 15:45:22 -0500 Subject: [PATCH] Remove the unspecified dependency methods --- lib/WebViewBridge/index.android.js | 8 +++----- lib/WebViewBridge/index.ios.js | 18 +++++++----------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lib/WebViewBridge/index.android.js b/lib/WebViewBridge/index.android.js index bdfe818..22d58f7 100644 --- a/lib/WebViewBridge/index.android.js +++ b/lib/WebViewBridge/index.android.js @@ -15,8 +15,6 @@ var React = require('react'); var ReactNative = require('react-native'); -var invariant = require('invariant'); -var keyMirror = require('keymirror'); var resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource'); var { @@ -37,11 +35,11 @@ var { PropTypes } = React; var RCT_WEBVIEWBRIDGE_REF = 'webviewbridge'; -var WebViewBridgeState = keyMirror({ +var WebViewBridgeState = { IDLE: null, LOADING: null, ERROR: null, -}); +}; var RCTWebViewBridge = requireNativeComponent('RCTWebViewBridge', WebViewBridge); @@ -67,7 +65,7 @@ var WebViewBridge = React.createClass({ }; }, - + componentWillMount: function() { DeviceEventEmitter.addListener("webViewBridgeMessage", (body) => { const { onBridgeMessage } = this.props; diff --git a/lib/WebViewBridge/index.ios.js b/lib/WebViewBridge/index.ios.js index e46223b..ff29c24 100644 --- a/lib/WebViewBridge/index.ios.js +++ b/lib/WebViewBridge/index.ios.js @@ -28,9 +28,6 @@ import { findNodeHandle } from 'react-native' -import invariant from 'fbjs/lib/invariant' -import keyMirror from 'fbjs/lib/keyMirror' - import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'; import processDecelerationRate from 'react-native/Libraries/Components/ScrollView/processDecelerationRate' import deprecatedPropType from 'react-native/Libraries/Utilities/deprecatedPropType' @@ -42,20 +39,20 @@ const { WebViewBridgeManager } = NativeModules var BGWASH = 'rgba(255,255,255,0.8)'; var RCT_WEBVIEW_REF = 'webview'; -var WebViewState = keyMirror({ +var WebViewState = { IDLE: null, LOADING: null, ERROR: null, -}); +}; -const NavigationType = keyMirror({ +const NavigationType = { click: true, formsubmit: true, backforward: true, reload: true, formresubmit: true, other: true, -}); +}; const JSNavigationScheme = 'react-js-navigation'; @@ -361,10 +358,9 @@ class WebView extends React.Component { otherView = (this.props.renderLoading || defaultRenderLoading)(); } else if (this.state.viewState === WebViewState.ERROR) { var errorEvent = this.state.lastErrorEvent; - invariant( - errorEvent != null, - 'lastErrorEvent expected to be non-null' - ); + if (errorEvent != null) { + throw new Error('lastErrorEvent expected to be non-null'); + } otherView = (this.props.renderError || defaultRenderError)( errorEvent.domain, errorEvent.code,