Description
Current behavior
AsyncStorage.getItem doesn't return a value with new react-native 0.66
Expected behavior
AsyncStorage.getItem should return a value with new react-native 0.66
Repro steps
- value is null in current example, but await AsyncStorage.getItem() doesn't return nothing; it returns null if pass legacy callback as second argument.
- console.log('value==============>', value) newer printed
static isAppInstalled = async () => {
try {
debugger
const value = await AsyncStorage.getItem(APP_INSTALLED_ASYNC_STORAGE_KEY, (e) => console.log('callback event',e));
console.log('value==============>', value)
return value !== APP_INSTALLED_ASYNC_STORAGE_VALUE;
} catch (_) {
return true;
}
};
Environment
-
Platforms tested:
- [+ ] iOS
-
AsyncStorage version: 1.15.9
-
Environment:
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 2.47 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.0 => 0.66.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found