You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js
+22
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,17 @@ function toObjCType(
104
104
returnwrapOptional('double');
105
105
case'BooleanTypeAnnotation':
106
106
returnwrapOptional('bool');
107
+
case'EnumDeclaration':
108
+
switch(typeAnnotation.memberType){
109
+
case'NumberTypeAnnotation':
110
+
returnwrapOptional('double');
111
+
case'StringTypeAnnotation':
112
+
return'NSString *';
113
+
default:
114
+
thrownewError(
115
+
`Couldn't convert enum into ObjC type: ${typeAnnotation.type}"`,
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js
+22
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,17 @@ function toObjCType(
95
95
returnwrapOptional('double');
96
96
case'BooleanTypeAnnotation':
97
97
returnwrapOptional('bool');
98
+
case'EnumDeclaration':
99
+
switch(typeAnnotation.memberType){
100
+
case'NumberTypeAnnotation':
101
+
returnwrapOptional('double');
102
+
case'StringTypeAnnotation':
103
+
return'NSString *';
104
+
default:
105
+
thrownewError(
106
+
`Couldn't convert enum into ObjC type: ${typeAnnotation.type}"`,
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJavaSpec-test.js.snap
+4
Original file line number
Diff line number
Diff line change
@@ -376,6 +376,10 @@ public abstract class NativeSampleTurboModuleSpec extends ReactContextBaseJavaMo
376
376
@ReactMethod
377
377
@DoNotStrip
378
378
public abstract void getValueWithPromise(boolean error, Promise promise);
379
+
380
+
@ReactMethod(isBlockingSynchronousMethod = true)
381
+
@DoNotStrip
382
+
public abstract String getEnums(double enumInt, double enumFloat, String enumString);
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniCpp-test.js.snap
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap
0 commit comments