Skip to content

Commit b2a1d2d

Browse files
sbecaKrzysztof Borowy
authored and
Krzysztof Borowy
committed
fix: react-native-windows support
Summary: The [react-native-windows](https://github.com/Microsoft/react-native-windows) repo provides Windows build target support to React Native projects. It provides AsyncStorage support through the module name `AsyncLocalStorage` (exact file is [here](https://github.com/Microsoft/react-native-windows/blob/master/RNWCS/ReactWindows/ReactNative/Modules/Storage/AsyncStorageModule.cs)) but commit 547445c removed the reference to `NativeModules.AsyncLocalStorage` from this repo which broke Windows support. This PR adds that back in.
1 parent 22d4e5e commit b2a1d2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AsyncStorage.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
const {NativeModules} = require('react-native');
1515

1616
const RCTAsyncStorage =
17-
NativeModules.RNC_AsyncSQLiteDBStorage || NativeModules.RNCAsyncStorage;
17+
NativeModules.AsyncLocalStorage || // Support for external modules, like react-native-windows
18+
NativeModules.RNC_AsyncSQLiteDBStorage ||
19+
NativeModules.RNCAsyncStorage;
1820

1921
if (!RCTAsyncStorage) {
2022
throw new Error(`@RNCommunity/AsyncStorage: NativeModule.RCTAsyncStorage is null.

0 commit comments

Comments
 (0)