Skip to content

Commit

Permalink
fix extraModulesForBridge: in interop
Browse files Browse the repository at this point in the history
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
  • Loading branch information
philIip authored and facebook-github-bot committed Nov 22, 2024
1 parent e2c621c commit 3575e21
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ - (void)invalidate
{
std::lock_guard<std::mutex> lock(_invalidationMutex);
_valid = false;
if (self->_reactInstance) {
self->_reactInstance->unregisterFromInspector();
if (_reactInstance) {
_reactInstance->unregisterFromInspector();
}
[_surfacePresenter suspend];
[_jsThreadManager dispatchToJSThread:^{
Expand Down Expand Up @@ -210,6 +210,15 @@ - (Class)getModuleClassFromName:(const char *)name
return nullptr;
}

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
if ([_appTMMDelegate respondsToSelector:@selector(extraModulesForBridge:)]) {
return [_appTMMDelegate extraModulesForBridge:nil];
}

return @[];
}

#pragma mark - Private

- (void)_start
Expand Down

0 comments on commit 3575e21

Please sign in to comment.