Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Arthur-codeX opened this issue Jul 19, 2022 · 5 comments

Comments

@Arthur-codeX
Copy link

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

@seigel
Copy link
Owner

seigel commented Jul 19, 2022

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.

@cxandros
Copy link

cxandros commented Jul 22, 2022

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

@seigel
Copy link
Owner

seigel commented Jul 22, 2022

I will take a look at this soon. Thanks!

@msotnikov
Copy link

@seigel I've made a PR #154

@maximiliancsuk
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants