Skip to content

Commit

Permalink
Strip RCT prefix in TurbooduleManager
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Dec 11, 2020
1 parent e0ece12 commit 2a175b1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ - (TurboModuleHolder *)_getOrCreateTurboModuleHolder:(const char *)moduleName
*/
- (id<RCTTurboModule>)provideRCTTurboModule:(const char *)moduleName
{
if (strncmp("RCT", moduleName, 3) == 0) {
moduleName = [[[NSString stringWithUTF8String:moduleName] substringFromIndex:3] UTF8String];
}

TurboModuleHolder *moduleHolder = [self _getOrCreateTurboModuleHolder:moduleName];

if (!moduleHolder) {
Expand Down

0 comments on commit 2a175b1

Please sign in to comment.