Skip to content

Commit 2a175b1

Browse files
Peter Arganyfacebook-github-bot
Peter Argany
authored andcommitted
Strip RCT prefix in TurbooduleManager
Summary: This is a followup to the issue described in D25477044, basically the TM cache can get messed up if `TurboModuleManager` is asked for "RCTNetworking" vs "Networking". This solves that issue globally. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D25480624 fbshipit-source-id: 2024560eadbcf58cdc3d7d5675b4120aa2fa2582
1 parent e0ece12 commit 2a175b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm

+4
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ - (TurboModuleHolder *)_getOrCreateTurboModuleHolder:(const char *)moduleName
358358
*/
359359
- (id<RCTTurboModule>)provideRCTTurboModule:(const char *)moduleName
360360
{
361+
if (strncmp("RCT", moduleName, 3) == 0) {
362+
moduleName = [[[NSString stringWithUTF8String:moduleName] substringFromIndex:3] UTF8String];
363+
}
364+
361365
TurboModuleHolder *moduleHolder = [self _getOrCreateTurboModuleHolder:moduleName];
362366

363367
if (!moduleHolder) {

0 commit comments

Comments
 (0)