diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js index 219978bb3a5280..2dc407f303476f 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js @@ -136,11 +136,11 @@ function translateFunctionParamToJavaType( case 'NumberTypeAnnotation': return wrapOptional('double', isRequired); case 'FloatTypeAnnotation': - return wrapOptional('double', isRequired); + return wrapOptional('float', isRequired); case 'DoubleTypeAnnotation': return wrapOptional('double', isRequired); case 'Int32TypeAnnotation': - return wrapOptional('double', isRequired); + return wrapOptional('int', isRequired); case 'BooleanTypeAnnotation': return wrapOptional('boolean', isRequired); case 'EnumDeclaration': diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js index d4544873fa2ac2..d024c4078a1fa9 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js @@ -334,9 +334,9 @@ function translateReturnTypeToJniType( case 'DoubleTypeAnnotation': return nullable ? 'Ljava/lang/Double;' : 'D'; case 'FloatTypeAnnotation': - return nullable ? 'Ljava/lang/Double;' : 'D'; + return nullable ? 'Ljava/lang/Float;' : 'F'; case 'Int32TypeAnnotation': - return nullable ? 'Ljava/lang/Double;' : 'D'; + return nullable ? 'Ljava/lang/Integer;' : 'I'; case 'PromiseTypeAnnotation': return 'Lcom/facebook/react/bridge/Promise;'; case 'GenericObjectTypeAnnotation':