Open Arthur-codeX opened 2 years ago
Thanks. Yeah...i have to find some cycles to clean this up, apply the myriad of changes that others have done to keep this working and move forward.
Hello, here is a patch for async storage, if you use version 7 you have to remove async storage from pouchdb-react-native package and install it separately.
diff --git a/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js b/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js
index a4c817e..ca18eb3 100644
--- a/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js
+++ b/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js
@@ -4,7 +4,7 @@
* Adapted from https://github.com/tradle/asyncstorage-down
*/
-import { AsyncStorage } from 'react-native'
+import AsyncStorage from '@react-native-async-storage/async-storage'
import {
safeJsonParse,
safeJsonStringify
@@ -109,4 +109,4 @@ AsyncStorageCore.destroy = function (dbName, callback) {
})
}
-module.exports = AsyncStorageCore
+export default AsyncStorageCore
for version 7 run
rm -r ./node_modules/pouchdb-react-native/node_modules/pouchdb-adapter-asyncstorage/
and the async-storage install
npm install --save @react-native-async-storage/async-storage
I will take a look at this soon. Thanks!
@seigel I've made a PR https://github.com/seigel/pouchdb-react-native/pull/154
Hello! Checking in because I have just stumbled on this error myself. Is there an update?
Warning: Async Storage has been extracted from react-native core and will be removed in a future release It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage