Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract getTypeAnnotationFromProperty from buildPropertiesForEvent in…
…to 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 #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 <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #37573 Test Plan: Flow: <img width="600" alt="image" src="https://github.com/facebook/react-native/assets/40902940/554bb82d-b492-4550-9a84-254fc4f78285"> Eslint: <img width="498" alt="image" src="https://github.com/facebook/react-native/assets/40902940/53a302b7-c2aa-4008-9583-2e3b4cddc14c"> Jest: <img width="395" alt="image" src="https://github.com/facebook/react-native/assets/40902940/c7ff53f1-2be1-4099-b2e6-081128cf5333"> Reviewed By: dmytrorykun Differential Revision: D46190831 Pulled By: cipolleschi fbshipit-source-id: 393a4c4968139ee7061ed4ea524d083af6950e38
- Loading branch information