You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, the signature of this method contains two types from C++:
40
+
The signature of this method contains two types from C++:
41
41
42
42
*`std::shared_ptr<facebook::react::TurboModule>`
43
43
*`facebook::react::ObjCTurboModule::InitParams`
44
44
45
45
### Solution
46
46
47
-
The idea is to wrap the `getTurboModule` invocation in a `TurboModuleWrapper` object.
47
+
The idea is to wrap the `getTurboModule` invocation in a `ModuleFactory` object.
48
48
49
49
The `TurboModuleWrapper` object is a base class that is supposed to be extended by a companion object for TurboModules. The base class has this interface:
50
50
```objc
@@ -65,7 +65,7 @@ When it comes to the implementation, the user-defined TurboModule won't have to
65
65
66
66
```objc
67
67
@implementation MyTurboModule
68
-
- (TurboModuleWrapper *)getWrapper
68
+
- (TurboModuleWrapper *)moduleFactory
69
69
{
70
70
return [[MyTurboModuleWrapper alloc] init];
71
71
}
@@ -121,9 +121,9 @@ Finally, we will have to update the `RCTTurboModuleManager` to take this new obj
121
121
Additionally we need to make sure that `React_Codegen` module is compatible with importing to Swift. I did a small test and adding few ifdefs to React_Codegen headers allows us to use Swift.
0 commit comments