Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions packages/react-native/React/Base/RCTBridgeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,25 @@ RCT_EXTERN_C_END

// With both legacy interop layers removed, RCTRegisterModule is compiled out, so
// static module registration is a no-op: only the JS module name is emitted.
#define RCT_EXPORT_MODULE(js_name) \
+(NSString *)moduleName \
{ \
return @ #js_name; \
#ifdef __cplusplus
#define _RCT_ASSERT_EXPORTED_MODULE_IS_TURBO_MODULE() \
static_assert( \
__is_convertible_to(__typeof__([self alloc]), id<RCTTurboModule>), \
"Without the legacy module interop, only RCTTurboModule classes are created: conform this module " \
"to RCTTurboModule (or its codegen spec) and implement getTurboModule:")
#else
#define _RCT_ASSERT_EXPORTED_MODULE_IS_TURBO_MODULE() \
_Static_assert( \
0, \
"Without the legacy module interop, only RCTTurboModule classes are created, which needs Objective-C++: " \
"rename this file to .mm and conform the module to RCTTurboModule")
#endif

#define RCT_EXPORT_MODULE(js_name) \
+(NSString *)moduleName \
{ \
_RCT_ASSERT_EXPORTED_MODULE_IS_TURBO_MODULE(); \
return @ #js_name; \
}

#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ - (void)showShareActionSheetWithOptions:
using namespace facebook::react;
@interface RCTActionSheetManager () <RCTTurboModule>
@end
@implementation RCTActionSheetManager
RCT_EXPORT_MODULE()
Expand Down
Loading