How do I add AsyncStorage to a project started with expo
See original GitHub issueI 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';
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:
- Created 4 years ago
- Reactions:14
- Comments:9 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@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.