Skip to content

Commit fa6d5ca

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Fabric: Fixes TurboModule method parameter Int32 type not work (facebook#49710)
Summary: Fixes facebook#49688 . ## Changelog: [IOS] [FIXED] - Fabric: Fixes TurboModule method parameter Int32 type not work Pull Request resolved: facebook#49710 Test Plan: Repro please see facebook#49688. Reviewed By: cortinico Differential Revision: D70314804 Pulled By: cipolleschi fbshipit-source-id: 4f305b14bb735bd343ef7477b969df237418615d
1 parent 63dea20 commit fa6d5ca

File tree

1 file changed

+4
-1
lines changed
  • packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon

1 file changed

+4
-1
lines changed

packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,15 @@ TraceSection s(
592592
double v = arg.getNumber();
593593

594594
/**
595-
* JS type checking ensures the Objective C argument here is either a double or NSNumber*.
595+
* JS type checking ensures the Objective C argument here is either a double or NSNumber* or NSInteger.
596596
*/
597597
if (objCArgType == @encode(id)) {
598598
id objCArg = [NSNumber numberWithDouble:v];
599599
[inv setArgument:(void *)&objCArg atIndex:i + 2];
600600
[retainedObjectsForInvocation addObject:objCArg];
601+
} else if (objCArgType == @encode(NSInteger)) {
602+
NSInteger integer = v;
603+
[inv setArgument:&integer atIndex:i + 2];
601604
} else {
602605
[inv setArgument:(void *)&v atIndex:i + 2];
603606
}

0 commit comments

Comments
 (0)