From 663a0187094b12d423742e65523c20e778925973 Mon Sep 17 00:00:00 2001 From: MaeIg Date: Tue, 6 Jun 2023 02:31:51 -0700 Subject: [PATCH] Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers (#37573) Summary: This PR aims to remove the duplicated logic in [flow|typescript]/components/events.js files to move it in specific parsers. It is a task of https://github.com/facebook/react-native/issues/34872: > [Codegen 114 - Assigned to MaeIg] Add a function getTypeAnnotationFromProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L174-L177) and parsers/typescript/components/events.js. Use the parsers in the buildPropertiesForEvent. ## Changelog: [Internal] [Changed] - Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers