简体   繁体   中英

TypeError: Cannot read property 'init' of undefined

import {manager, ReactCBLite} from 'react-native-couchbase-lite';

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

Running this code in react-native for ios getting TypeError: Cannot read property 'init' of undefined

From the documentation :

import Couchbase from "react-native-couchbase-lite";

Couchbase.initRESTClient(manager => {
   // use manager to perform operations
});

It seems there is no only init method, but there are other init methods you should use.

Pay attention that there are also special steps needed to be taken for iOS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM