【问题标题】:TypeError: Cannot read property 'init' of undefinedTypeError:无法读取未定义的属性“init”
【发布时间】:2021-09-28 14:40:59
【问题描述】:
import {manager, ReactCBLite} from 'react-native-couchbase-lite';

ReactCBLite.init(8091, 'admin', 'admin123', e => {
    console.log('initialized');
});

在 react-native 中运行此代码以获取 TypeError: Cannot read property 'init' of undefined

【问题讨论】:

    标签: ios react-native ios-simulator react-native-ios simulator


    【解决方案1】:

    来自documentation

    import Couchbase from "react-native-couchbase-lite";
    
    Couchbase.initRESTClient(manager => {
       // use manager to perform operations
    });
    

    似乎不仅有 init 方法,还有其他的 init 方法你应该使用。

    请注意,iOS 还需要采取一些特殊步骤。

    【讨论】:

      猜你喜欢
      • 2019-09-16
      • 2017-07-20
      • 1970-01-01
      • 2022-07-06
      • 2020-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多