Skip to content

Commit 3575e21

Browse files
philIipfacebook-github-bot
authored andcommitted
fix extraModulesForBridge: in interop
Summary: Changelog: [Internal] the delegate of TMM is RCTInstance, but RCTInstance doesn't forward all of the APIs and we aren't protected by the compiler because of the optional in TMMDelegate i found that this backwards compat API did not actually get set up correctly and was never working in the first place... this is why we should avoid optional long term, TMMDelegate needs to be pushed down to the infra layer and not exist in product, cc blakef Reviewed By: javache Differential Revision: D66148789 fbshipit-source-id: 925a6d4ebb6ba6bfb0b1aec6710695e7551ba475
1 parent e2c621c commit 3575e21

File tree

1 file changed

+11
-2
lines changed
  • packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon

1 file changed

+11
-2
lines changed

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ - (void)invalidate
144144
{
145145
std::lock_guard<std::mutex> lock(_invalidationMutex);
146146
_valid = false;
147-
if (self->_reactInstance) {
148-
self->_reactInstance->unregisterFromInspector();
147+
if (_reactInstance) {
148+
_reactInstance->unregisterFromInspector();
149149
}
150150
[_surfacePresenter suspend];
151151
[_jsThreadManager dispatchToJSThread:^{
@@ -210,6 +210,15 @@ - (Class)getModuleClassFromName:(const char *)name
210210
return nullptr;
211211
}
212212

213+
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
214+
{
215+
if ([_appTMMDelegate respondsToSelector:@selector(extraModulesForBridge:)]) {
216+
return [_appTMMDelegate extraModulesForBridge:nil];
217+
}
218+
219+
return @[];
220+
}
221+
213222
#pragma mark - Private
214223

215224
- (void)_start

0 commit comments

Comments
 (0)