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 36ffbbead3ad9b..2944905d1e7869 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -179,6 +179,7 @@ function translateTypeAnnotation( ); if (indexers.length > 0) { // check the property type to prevent developers from using unsupported types + // the return value from `translateTypeAnnotation` is unused const propertyType = indexers[0].value; translateTypeAnnotation( hasteModuleName, @@ -265,8 +266,9 @@ function translateTypeAnnotation( case 'MixedTypeAnnotation': { if (cxxOnly) { return emitMixed(nullable); + } else { + return emitObject(nullable); } - // Fallthrough } default: { throw new UnsupportedTypeAnnotationParserError( diff --git a/packages/react-native-codegen/src/parsers/typescript/modules/index.js b/packages/react-native-codegen/src/parsers/typescript/modules/index.js index 71a904544d213c..25922bf4108210 100644 --- a/packages/react-native-codegen/src/parsers/typescript/modules/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/modules/index.js @@ -198,6 +198,7 @@ function translateTypeAnnotation( ); if (indexSignatures.length > 0) { // check the property type to prevent developers from using unsupported types + // the return value from `translateTypeAnnotation` is unused const propertyType = indexSignatures[0].typeAnnotation; translateTypeAnnotation( hasteModuleName,