import { NativeModules, Platform, PlatformOSType } from "react-native"; import { CouchbaseLiteNativeModule } from "./privateTypes"; let RNCouchbaseLite: CouchbaseLiteNativeModule | undefined = NativeModules.RNCouchbaseLite; const OS: PlatformOSType = Platform.OS; console.log(NativeModules) if (!RNCouchbaseLite) { // Produce an error if we don't have the native module if (OS === "android" || OS === "ios") { throw new Error(`react-native-couchbaselite: NativeModule.RNCouchbaseLite is null. To fix this issue try these steps: • For react-native <= 0.59: Run \`react-native link react-native-couchbaselite\` 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. If none of these fix the issue, please open an issue on the Github repository: https://github.com/ZHoussemEddine/react-native-couchbaselite.git`); } } export default RNCouchbaseLite as CouchbaseLiteNativeModule;