question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I add AsyncStorage to a project started with expo

See original GitHub issue

I want to use AsynStorage for a project which was started with expo init.

I added the library with yarn add @react-native-community/async-storage

When I try to import AsyncStorage in my project file like below, I get the error shown in the screenshot.

import AsyncStorage from '@react-native-community/async-storage';

rnc-issue

When I try to run this command react-native link @react-native-community/async-storage as directed in the docs, I get the following error 'react-native' is not recognized as an internal or external command, operable program or batch file

How do I resolve this issue. I have tested on both my android phone and on a Genymotion virtual android device.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
krizzucommented, Apr 12, 2019

@mathiasseyfert Each major Expo release comes with upgraded RN version. You can see it here.

Async Storage on RN is deprecated, because it’s been extracted to separate module, which is backward compatible. It’s the same module, but lives elsewhere.

So I believe Next releases of expo will just move to use external modules, to not break compatibility.

thanks.

11reactions
krizzucommented, Apr 12, 2019

@chidimo Yes, you’re right.

Expo comes with pretty nice and robust collection of native modules. Since RN is extracting it’s internal Native Modules to external repos, it’s just a matter of time when expo will adjust to this.

TBH, I wouldn’t care much for the deprecation warning, it’s just a hint that next minor RN release would not have Async Storage in-built.

thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AsyncStorage - Expo Documentation
AsyncStorage. An asynchronous, unencrypted, persistent, key-value storage API. Platform Compatibility. Android Device, Android Emulator, iOS Device ...
Read more >
Asyncstorage in react-native with Expo - Medium
An asynchronous, unencrypted, persistent, key-value storage API. Firstly import the package from Expo. import AsyncStorage from '@react-native-async-storage/ ...
Read more >
Using ASYNC STORAGE w/React Native & Expo - YouTube
Get notified about my upcoming Instagram clone course! https://www.instaclone.app - Now with voice explanation! Let's check out what Async ...
Read more >
Learn AsyncStorage in React Native Expo - YouTube
This video will show you how to install AsyncStorage, react-navigation, and make user signed in using async storage,
Read more >
Installation | Async Storage - GitHub Pages
Installation ; npm install @react-native-async-storage/async-storage ; yarn add @react-native-async-storage/async-storage ; npx expo install @react-native-async- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found