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.

Null AsyncStorage when specifying react-native-community/async-storage

See original GitHub issue

Just upgraded from 5.10.0 to 6.0.0. I’m using the following versions:

expo: 3.11.1 react: 16.9.0 react-native: 0.61.4 redux: 4.0.4 redux-persist: 6.0.0

After make the changes as explained in the documentation I started to get an red screen error with the message “AsyncStorage is null”

I changed my code as shown in the documentation:

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

const persistConfig = {
    storage: AsyncStorage
};

I don’t know if this problem is related to redux-persist or to async-store. Anyway I’m describing the problema here first. Hope I can get some help. Thanks.

redscreen

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

6reactions
rekcommented, Dec 18, 2019

import {AsyncStorage} from 'react-native'; seems to work ok now with expo 36

1reaction
BlindBadCatcommented, Dec 13, 2019

Yes, let’s wait for the upgrade =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - NativeModule: AsyncStorage is null, with @RNC ...
To fix this issue try these steps: -Run `react-native link @react-native-community/async-storage` in the project root. -Rebuild and restart the ...
Read more >
How To Use React Native AsyncStorage | Jscrambler - Medium
AsyncStorage is a simple, asynchronous, unencrypted by default module that allows you to persist data offline in React Native apps. Learn more about...
Read more >
AsyncStorage - React Native
AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of ...
Read more >
AsyncStorage - React Native Express
This will return a Promise containing a string, or null if no data has been stored yet ... import AsyncStorage from '@react-native-community/async-storage'.
Read more >
React Native AsyncStorage Example: When I Die App - Soshace
import AsyncStorage from '@react-native-community/async-storage';. Define a new state for the component.
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