mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
966f3cdea3
Summary: This PR is a task from https://github.com/facebook/react-native/issues/34872: > Extract the content of the case 'Promise' ([Flow](https://github.com/facebook/react-native/blob/b444f0e44e0d8670139acea5f14c2de32c5e2ddc/packages/react-native-codegen/src/parsers/flow/modules/index.js#L90-L97), [TypeScript](https://github.com/facebook/react-native/blob/00b795642a6562fb52d6df12e367b84674994623/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L197-L205)) into a single emitPromise function in the parsers-primitives.js file. Use the new function in the parsers. Note that this PR should be merged after https://github.com/facebook/react-native/pull/34933 ## 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] - Extract contents of the case 'Promise' into a single emitPromise function inside parsers-primitives Pull Request resolved: https://github.com/facebook/react-native/pull/34935 Test Plan: I tested using jest and flow commands. Reviewed By: cipolleschi Differential Revision: D40257033 Pulled By: cipolleschi fbshipit-source-id: 0246f43c6b688629e2de1259e7f535c2cf6dd0a4
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.