Files
solelog/.yarn/patches/@react-native-community+netinfo+11.4.1.patch
Bas van Rossem d94d0b188b Initial commit: code as received (Create/Anything export)
Insole-production time tracker exported from the Create/Anything AI
platform. Baseline snapshot before any reverse-engineering or cleanup.

- apps/mobile: Expo Router app (iOS/Android/web), the only workspace
- publisher/: standalone OpenNext/AWS deploy tooling for the web side
- Backend (/api/tasks, /api/logs + DB) lives remotely, not in this repo
2026-06-17 10:19:33 +02:00

43 lines
1.9 KiB
Diff

diff --git a/src/internal/nativeInterface.ts b/src/internal/nativeInterface.ts
index 8b514f4..9135364 100644
--- a/src/internal/nativeInterface.ts
+++ b/src/internal/nativeInterface.ts
@@ -7,28 +7,15 @@
* @format
*/
-import {NativeEventEmitter} from 'react-native';
+import { NativeEventEmitter } from 'react-native';
import RNCNetInfo from './nativeModule';
-// Produce an error if we don't have the native module
-if (!RNCNetInfo) {
- throw new Error(`@react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:
-
-• Run \`react-native link @react-native-community/netinfo\` in the project root.
-• Rebuild and re-run the app.
-• 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.
-• Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.
-* If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.
-
-If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo`);
-}
-
/**
* We export the native interface in this way to give easy shared access to it between the
* JavaScript code and the tests
*/
let nativeEventEmitter: NativeEventEmitter | null = null;
-const nativeInterface = Object.assign(RNCNetInfo, {
+const nativeInterface = RNCNetInfo ? Object.assign(RNCNetInfo, {
get eventEmitter(): NativeEventEmitter {
if (!nativeEventEmitter) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -39,5 +26,5 @@ const nativeInterface = Object.assign(RNCNetInfo, {
/// @ts-ignore
return nativeEventEmitter;
},
-});
+}) : {};
export default nativeInterface;