diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index b141a28b12f..48047fe186f 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -23,16 +23,16 @@ export type CommandsFunctionTypeParamAnnotation = $ReadOnly<{| |}>; export type CommandsTypeAnnotation = - | ReservedFunctionValueTypeAnnotation + | ReservedTypeAnnotation | BooleanTypeAnnotation | Int32TypeAnnotation | DoubleTypeAnnotation | FloatTypeAnnotation | StringTypeAnnotation; -type ReservedFunctionValueTypeAnnotation = $ReadOnly<{| - type: 'ReservedFunctionValueTypeAnnotation', - name: ReservedFunctionValueTypeName, +export type ReservedTypeAnnotation = $ReadOnly<{| + type: 'ReservedTypeAnnotation', + name: 'RootTag', // Union with more custom types. |}>; export type DoubleTypeAnnotation = $ReadOnly<{| @@ -318,11 +318,6 @@ export type NativeModuleGenericObjectTypeAnnotation = $ReadOnly<{| type: 'GenericObjectTypeAnnotation', |}>; -export type NativeModuleReservedFunctionValueTypeAnnotation = $ReadOnly<{| - type: 'ReservedFunctionValueTypeAnnotation', - name: ReservedFunctionValueTypeName, -|}>; - export type NativeModuleTypeAliasTypeAnnotation = $ReadOnly<{| type: 'TypeAliasTypeAnnotation', name: string, @@ -344,7 +339,7 @@ export type NativeModuleBaseTypeAnnotation = | NativeModuleFloatTypeAnnotation | NativeModuleBooleanTypeAnnotation | NativeModuleGenericObjectTypeAnnotation - | NativeModuleReservedFunctionValueTypeAnnotation + | ReservedTypeAnnotation | NativeModuleTypeAliasTypeAnnotation | NativeModuleArrayTypeAnnotation> | NativeModuleObjectTypeAnnotation; @@ -366,5 +361,3 @@ type NativeModuleParamOnlyTypeAnnotation = NativeModuleFunctionTypeAnnotation; type NativeModuleReturnOnlyTypeAnnotation = | NativeModulePromiseTypeAnnotation | NativeModuleVoidTypeAnnotation; - -export type ReservedFunctionValueTypeName = 'RootTag'; // Union with more custom types. diff --git a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js index 978c46887ec..467d02bcdae 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js @@ -107,7 +107,7 @@ function getObjCParamType(param: CommandsFunctionTypeParamAnnotation): string { const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return 'double'; @@ -137,7 +137,7 @@ function getObjCExpectedKindParamType( const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return '[NSNumber class]'; @@ -167,7 +167,7 @@ function getReadableExpectedKindParamType( const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return 'double'; @@ -198,7 +198,7 @@ function getObjCRightHandAssignmentParamType( const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return `[(NSNumber *)arg${index} doubleValue]`; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index e1bb022ba4e..c963d8b61e2 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -157,7 +157,7 @@ function getCommandArgJavaType(param, index) { const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return `args.getDouble(${index})`; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js index a357470ce29..d5e26c745a8 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js @@ -128,7 +128,7 @@ function getCommandArgJavaType(param) { const {typeAnnotation} = param; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return 'double'; diff --git a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js index 02cae025420..5e82ace6335 100644 --- a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js @@ -1537,7 +1537,7 @@ const COMMANDS_AND_PROPS: SchemaType = { { name: 'rootTag', typeAnnotation: { - type: 'ReservedFunctionValueTypeAnnotation', + type: 'ReservedTypeAnnotation', name: 'RootTag', }, }, diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js index 48f70b5b7af..5050f213707 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js @@ -118,7 +118,7 @@ function serializeArg( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return wrap('.getNumber()'); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index 1f37cc08365..7b53dea5bfb 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -78,7 +78,7 @@ function translatePrimitiveJSTypeToCpp( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return 'double'; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js index dcb39b11ebd..a18315346d1 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJavaSpec.js @@ -118,7 +118,7 @@ function translateFunctionParamToJavaType( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return !isRequired ? 'Double' : 'double'; @@ -188,7 +188,7 @@ function translateFunctionReturnTypeToJavaType( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return nullable ? 'Double' : 'double'; @@ -245,7 +245,7 @@ function getFalsyReturnStatementFromReturnType( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return 'return 0.0;'; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js index f13c8ee54ca..8b4a9317766 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js @@ -137,7 +137,7 @@ function translateReturnTypeToKind( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return 'NumberKind'; @@ -194,7 +194,7 @@ function translateParamTypeToJniType( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return !isRequired ? 'Ljava/lang/Double;' : 'D'; @@ -244,7 +244,7 @@ function translateReturnTypeToJniType( } switch (realTypeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (realTypeAnnotation.name) { case 'RootTag': return nullable ? 'Ljava/lang/Double;' : 'D'; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js index 13c3c1031ab..ae48982139a 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js @@ -20,7 +20,7 @@ import type { NativeModuleFloatTypeAnnotation, NativeModuleBooleanTypeAnnotation, NativeModuleGenericObjectTypeAnnotation, - NativeModuleReservedFunctionValueTypeAnnotation, + ReservedTypeAnnotation, NativeModuleTypeAliasTypeAnnotation, NativeModuleArrayTypeAnnotation, NativeModuleBaseTypeAnnotation, @@ -64,7 +64,7 @@ export type StructTypeAnnotation = | NativeModuleFloatTypeAnnotation | NativeModuleBooleanTypeAnnotation | NativeModuleGenericObjectTypeAnnotation - | NativeModuleReservedFunctionValueTypeAnnotation + | ReservedTypeAnnotation | NativeModuleTypeAliasTypeAnnotation | NativeModuleArrayTypeAnnotation>; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js index 0e7f2ab9e2b..0579c28f925 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeConstantsStruct.js @@ -87,7 +87,7 @@ function toObjCType( }; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return wrapFollyOptional('double'); @@ -152,7 +152,7 @@ function toObjCValue( } switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return wrapPrimitive('double'); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js index 60e5859a5ca..3eb5155201d 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js @@ -76,7 +76,7 @@ function toObjCType( }; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return wrapFollyOptional('double'); @@ -140,7 +140,7 @@ function toObjCValue( }; switch (typeAnnotation.type) { - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return RCTBridgingTo('Double'); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js index d5db63c7610..bf12da4ecfa 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js @@ -246,7 +246,7 @@ function getParamObjCType( ' &', ); } - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (structTypeAnnotation.name) { case 'RootTag': return notStruct(notRequired ? 'NSNumber *' : 'double'); @@ -308,7 +308,7 @@ function getReturnObjCType( typeAnnotation.elementType, )}> *`, ); - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': return wrapIntoNullableIfNeeded('NSNumber *'); @@ -358,7 +358,7 @@ function getReturnJSType( return 'ObjectKind'; case 'ArrayTypeAnnotation': return 'ArrayKind'; - case 'ReservedFunctionValueTypeAnnotation': + case 'ReservedTypeAnnotation': return 'NumberKind'; case 'StringTypeAnnotation': return 'StringKind'; diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js index 17d2f010804..eb1f8ddd6f1 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js @@ -185,7 +185,7 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { typeAnnotation: { type: 'FunctionTypeAnnotation', returnTypeAnnotation: { - type: 'ReservedFunctionValueTypeAnnotation', + type: 'ReservedTypeAnnotation', name: 'RootTag', }, params: [ @@ -193,7 +193,7 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { optional: false, name: 'arg', typeAnnotation: { - type: 'ReservedFunctionValueTypeAnnotation', + type: 'ReservedTypeAnnotation', name: 'RootTag', }, }, diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap index 51bcdca03c4..61cef441150 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap @@ -2925,7 +2925,7 @@ exports[`RN Codegen Flow Parser can generate fixture COMMANDS_DEFINED_WITH_ALL_T { 'name': 'rootTag', 'typeAnnotation': { - 'type': 'ReservedFunctionValueTypeAnnotation', + 'type': 'ReservedTypeAnnotation', 'name': 'RootTag' } } diff --git a/packages/react-native-codegen/src/parsers/flow/components/commands.js b/packages/react-native-codegen/src/parsers/flow/components/commands.js index 92aef0a2ad0..b6b2ce39b95 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/commands.js +++ b/packages/react-native-codegen/src/parsers/flow/components/commands.js @@ -49,7 +49,7 @@ function buildCommandSchema(property, types: TypeDeclarationMap) { switch (type) { case 'RootTag': returnType = { - type: 'ReservedFunctionValueTypeAnnotation', + type: 'ReservedTypeAnnotation', name: 'RootTag', }; break; diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap index 5aca4040dbc..0592287aea1 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap @@ -1236,7 +1236,7 @@ exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ROOT_TAG 'typeAnnotation': { 'type': 'FunctionTypeAnnotation', 'returnTypeAnnotation': { - 'type': 'ReservedFunctionValueTypeAnnotation', + 'type': 'ReservedTypeAnnotation', 'name': 'RootTag' }, 'params': [ @@ -1244,7 +1244,7 @@ exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ROOT_TAG 'name': 'rootTag', 'optional': false, 'typeAnnotation': { - 'type': 'ReservedFunctionValueTypeAnnotation', + 'type': 'ReservedTypeAnnotation', 'name': 'RootTag' } } diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-e2e-test.js b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-e2e-test.js index bf2e29082f0..fc03e16e360 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-e2e-test.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-e2e-test.js @@ -9,7 +9,6 @@ */ import type { - ReservedFunctionValueTypeName, NativeModuleReturnTypeAnnotation, NativeModuleBaseTypeAnnotation, NativeModuleSchema, @@ -43,7 +42,7 @@ const PRIMITIVES: $ReadOnlyArray<[string, PrimitiveTypeAnnotationType]> = [ ['boolean', 'BooleanTypeAnnotation'], ]; -const RESERVED_FUNCTION_VALUE_TYPE_NAME: $ReadOnlyArray = [ +const RESERVED_FUNCTION_VALUE_TYPE_NAME: $ReadOnlyArray<'RootTag'> = [ 'RootTag', ]; @@ -201,12 +200,9 @@ describe('Flow Module Parser', () => { it(`should parse methods that have ${PARAM_TYPE_DESCRIPTION} parameter of reserved type '${FLOW_TYPE}'`, () => { const [paramTypeAnnotation] = parseParamType('arg', FLOW_TYPE); - expect(paramTypeAnnotation.type).toBe( - 'ReservedFunctionValueTypeAnnotation', - ); + expect(paramTypeAnnotation.type).toBe('ReservedTypeAnnotation'); invariant( - paramTypeAnnotation.type === - 'ReservedFunctionValueTypeAnnotation', + paramTypeAnnotation.type === 'ReservedTypeAnnotation', 'Param must be a Reserved type', ); @@ -267,13 +263,8 @@ describe('Flow Module Parser', () => { 'arg', FLOW_TYPE, ); - expect(elementType.type).toBe( - 'ReservedFunctionValueTypeAnnotation', - ); - invariant( - elementType.type === 'ReservedFunctionValueTypeAnnotation', - '', - ); + expect(elementType.type).toBe('ReservedTypeAnnotation'); + invariant(elementType.type === 'ReservedTypeAnnotation', ''); expect(elementType.name).toBe(FLOW_TYPE); }); @@ -511,11 +502,10 @@ describe('Flow Module Parser', () => { FLOW_TYPE, ); expect(prop.typeAnnotation.type).toBe( - 'ReservedFunctionValueTypeAnnotation', + 'ReservedTypeAnnotation', ); invariant( - prop.typeAnnotation.type === - 'ReservedFunctionValueTypeAnnotation', + prop.typeAnnotation.type === 'ReservedTypeAnnotation', '', ); @@ -583,12 +573,9 @@ describe('Flow Module Parser', () => { FLOW_TYPE, ); - expect(elementType.type).toBe( - 'ReservedFunctionValueTypeAnnotation', - ); + expect(elementType.type).toBe('ReservedTypeAnnotation'); invariant( - elementType.type === - 'ReservedFunctionValueTypeAnnotation', + elementType.type === 'ReservedTypeAnnotation', '', ); expect(elementType.name).toBe(FLOW_TYPE); @@ -800,11 +787,10 @@ describe('Flow Module Parser', () => { it(`should parse methods that have ${RETURN_TYPE_DESCRIPTION} reserved return of type '${FLOW_TYPE}'`, () => { const [returnTypeAnnotation] = parseReturnType(FLOW_TYPE); expect(returnTypeAnnotation.type).toBe( - 'ReservedFunctionValueTypeAnnotation', + 'ReservedTypeAnnotation', ); invariant( - returnTypeAnnotation.type === - 'ReservedFunctionValueTypeAnnotation', + returnTypeAnnotation.type === 'ReservedTypeAnnotation', '', ); expect(returnTypeAnnotation.name).toBe(FLOW_TYPE); @@ -863,13 +849,8 @@ describe('Flow Module Parser', () => { RESERVED_FUNCTION_VALUE_TYPE_NAME.forEach(FLOW_TYPE => { it(`should parse methods that have ${RETURN_TYPE_DESCRIPTION} return of type 'Array<${FLOW_TYPE}>'`, () => { const [elementType] = parseArrayElementReturnType(FLOW_TYPE); - expect(elementType.type).toBe( - 'ReservedFunctionValueTypeAnnotation', - ); - invariant( - elementType.type === 'ReservedFunctionValueTypeAnnotation', - '', - ); + expect(elementType.type).toBe('ReservedTypeAnnotation'); + invariant(elementType.type === 'ReservedTypeAnnotation', ''); expect(elementType.name).toBe(FLOW_TYPE); }); @@ -1079,11 +1060,11 @@ describe('Flow Module Parser', () => { ); expect(property.typeAnnotation.type).toBe( - 'ReservedFunctionValueTypeAnnotation', + 'ReservedTypeAnnotation', ); invariant( property.typeAnnotation.type === - 'ReservedFunctionValueTypeAnnotation', + 'ReservedTypeAnnotation', '', ); @@ -1152,12 +1133,9 @@ describe('Flow Module Parser', () => { 'prop', FLOW_TYPE, ); - expect(elementType.type).toBe( - 'ReservedFunctionValueTypeAnnotation', - ); + expect(elementType.type).toBe('ReservedTypeAnnotation'); invariant( - elementType.type === - 'ReservedFunctionValueTypeAnnotation', + elementType.type === 'ReservedTypeAnnotation', '', ); diff --git a/packages/react-native-codegen/src/parsers/flow/modules/index.js b/packages/react-native-codegen/src/parsers/flow/modules/index.js index 9c71bd6704e..76727185f01 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -70,7 +70,7 @@ function translateTypeAnnotation( switch (typeAnnotation.id.name) { case 'RootTag': { return wrapNullable(nullable, { - type: 'ReservedFunctionValueTypeAnnotation', + type: 'ReservedTypeAnnotation', name: 'RootTag', }); }