pouchdb-react-native icon indicating copy to clipboard operation
pouchdb-react-native copied to clipboard

Async Storage has been extracted from react-native core and will be removed in a future release.

Open Arthur-codeX opened this issue 2 years ago • 5 comments

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

Arthur-codeX avatar Jul 19 '22 19:07 Arthur-codeX

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.

seigel avatar Jul 19 '22 21:07 seigel

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

cxandros avatar Jul 22 '22 14:07 cxandros

I will take a look at this soon. Thanks!

seigel avatar Jul 22 '22 14:07 seigel

@seigel I've made a PR https://github.com/seigel/pouchdb-react-native/pull/154

msotnikov avatar Sep 01 '22 13:09 msotnikov

Hello! Checking in because I have just stumbled on this error myself. Is there an update?

maximiliancsuk avatar Mar 08 '23 10:03 maximiliancsuk