From 01c3bcdab04f842b8996e2ea3311ebd48785af54 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 22 Jun 2021 15:30:41 -0700 Subject: [PATCH] Support string type for commands Summary: String type seems to be already supported by codegen, but it was not included in the list for command methods. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D29306740 fbshipit-source-id: 44b267c09f471dc601759ed2f7211a9e0fc1bb90 --- .../src/parsers/flow/components/commands.js | 5 +++++ 1 file changed, 5 insertions(+) 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 48103dc595f..c967645211f 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/commands.js +++ b/packages/react-native-codegen/src/parsers/flow/components/commands.js @@ -76,6 +76,11 @@ function buildCommandSchema(property, types: TypeDeclarationMap) { type: 'FloatTypeAnnotation', }; break; + case 'StringTypeAnnotation': + returnType = { + type: 'StringTypeAnnotation', + }; + break; default: (type: empty); throw new Error(