UNPKG

@react-native-community/netinfo

Version:
2 lines 1.22 kB
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));var _reactNative=require("react-native");var RNCNetInfo=_reactNative.NativeModules.RNCNetInfo;if(!RNCNetInfo){throw new Error("@react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:\n\n\u2022 Run `react-native link @react-native-community/netinfo` in the project root.\n\u2022 Rebuild and re-run the app.\n\u2022 If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n\nIf none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo");}var nativeEventEmitter=null;var _default=(0,_objectSpread2.default)({},RNCNetInfo,{get eventEmitter(){if(!nativeEventEmitter){nativeEventEmitter=new _reactNative.NativeEventEmitter(RNCNetInfo);}return nativeEventEmitter;}});exports.default=_default; //# sourceMappingURL=nativeInterface.js.map