mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0627cd69cd
Summary: Part of https://github.com/facebook/react-native/issues/34872 > [Assigned to youedd] This task is more advanced than the others Create a function to unify the [unionType](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L372-L396) and the [TSUnionType](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L407-L431). This task may share some logic from the previous task. The function should accept a ParserType parameter to implement the proper logic to extract the memberType variable. Ideally, we should create a couple of supporting functions to implement those logics. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Refactor translate UniontypeAnnotation Pull Request resolved: https://github.com/facebook/react-native/pull/35050 Test Plan: `yarn jest react-native-codegen`  Reviewed By: cortinico Differential Revision: D40637299 Pulled By: cipolleschi fbshipit-source-id: 1490001a3398c3af79d465c40de3c3687f058523
react-native-codegen
Installation
yarn add --dev react-native-codegen
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the react Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest react-native-codegen.