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 af2ce50a985c3c..fae2c38d0a3b4b 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -173,6 +173,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, @@ -259,8 +260,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 cbf1781c08d961..7c1750ad3354e5 100644 --- a/packages/react-native-codegen/src/parsers/typescript/modules/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/modules/index.js @@ -191,6 +191,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,