File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 10
10
#import < React/RCTBridgeModule.h>
11
11
#import < React/RCTInvalidating.h>
12
12
13
+ #ifdef RCT_NEW_ARCH_ENABLED
14
+ #import < rnasyncstorage/rnasyncstorage.h>
15
+ #endif
16
+
13
17
#import " RNCAsyncStorageDelegate.h"
14
18
15
19
/* *
23
27
*
24
28
* Keys and values must always be strings or an error is returned.
25
29
*/
26
- @interface RNCAsyncStorage : NSObject <RCTBridgeModule, RCTInvalidating>
30
+ @interface RNCAsyncStorage : NSObject <
31
+ #ifdef RCT_NEW_ARCH_ENABLED
32
+ NativeAsyncStorageModuleSpec
33
+ #else
34
+ RCTBridgeModule
35
+ #endif
36
+ , RCTInvalidating>
27
37
28
38
@property (nonatomic , weak , nullable ) id <RNCAsyncStorageDelegate> delegate;
29
39
Original file line number Diff line number Diff line change @@ -895,4 +895,12 @@ - (BOOL)_passthroughDelegate
895
895
}
896
896
}
897
897
898
+ #if RCT_NEW_ARCH_ENABLED
899
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule :
900
+ (const facebook::react::ObjCTurboModule::InitParams &)params
901
+ {
902
+ return std::make_shared<facebook::react::NativeAsyncStorageModuleSpecJSI>(params);
903
+ }
904
+ #endif
905
+
898
906
@end
Original file line number Diff line number Diff line change 2
2
import { NativeModules , TurboModuleRegistry } from 'react-native' ;
3
3
import { shouldFallbackToLegacyNativeModule } from './shouldFallbackToLegacyNativeModule' ;
4
4
5
+ import AsyncStorageTurboModule from './NativeAsyncStorageModule' ;
6
+
5
7
let RCTAsyncStorage =
8
+ AsyncStorageTurboModule ||
6
9
NativeModules [ 'PlatformLocalStorage' ] || // Support for external modules, like react-native-windows
7
10
NativeModules [ 'RNC_AsyncSQLiteDBStorage' ] ||
8
11
NativeModules [ 'RNCAsyncStorage' ] ;
You can’t perform that action at this time.
0 commit comments