Skip to content

Commit e0b8f50

Browse files
RSNarafacebook-github-bot
authored andcommitted
Make RCTTurboModule getTurboModule: required
Summary: ## Rationale There are two ways to associate NativeModule ObjC objects with ObjCTurboModule jsi::HostObjects: 1. Via the NativeModule ObjC class's `getTurboModule:` method. 2. Via the TurboModule manager delegate's getTurboModule:initParams: method. There's no good reason to support both options. So, this diff stack removes 2, and make 1 mandatory for all RCTTurboModules. Not only will this simplify the infra, but it should also help eliminate a class of runtime errors in the TurboModule standalone app migration: you forget to implement the getTurboModule: method. Changelog: [iOS][Changed] - Make RCTTurboModule getTurboModule: required Reviewed By: PeteTheHeat Differential Revision: D27316129 fbshipit-source-id: baccd155b8c191d0f961b316db552bdfdbeb0a97
1 parent 3f38186 commit e0b8f50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.h

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule {
111111
*/
112112
@property (nonatomic, weak) id<RCTTurboModuleRegistry> turboModuleRegistry;
113113

114+
@required
114115
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
115116
(const facebook::react::ObjCTurboModule::InitParams &)params;
116117

0 commit comments

Comments
 (0)