Closed
Description
Current behavior
Async Storage not working with very basic use case. When I changed my import from using the extracted repo import AsyncStorage from '@react-native-community/async-storage';
to the core repoimport AsyncStorage from 'react-native'
it works.
saveFoo(template) {
AsyncStorage.getItem('savedFoos').then(b => {
if (b == null) {
AsyncStorage.setItem('savedFoos', JSON.stringify([template]));
}
else {
var savedFoos = JSON.parse(b);
savedFoos.push(template);
AsyncStorage.setItem('savedFoos', JSON.stringify(savedFoos));
}
});
}
Expected behavior
works
nothing was set to asyncstorage. SetItem failed.
Repro steps
above code
Environment
- Async Storage version: "@react-native-community/async-storage": "github:react-native-community/async-storage",
- React-Native version: RN 60.4
- Platform tested: iOS
- Logs/Error that are relevant:
Metadata
Metadata
Assignees
Labels
No labels