mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
eda90e5181
Summary: This PR extracts the content of the codegen case 'String' into a single `emitString` function inside the parsers-primitives.js file and uses it in both Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872. This also adds unit tests to the new `emitString` function. ref: https://github.com/facebook/react-native/pull/34936 ## 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 the content of the case 'StringTypeAnnotation' into a single emitString function Pull Request resolved: https://github.com/facebook/react-native/pull/34981 Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green Reviewed By: cortinico Differential Revision: D40376836 Pulled By: cipolleschi fbshipit-source-id: feb1b07ec7fc2c333f5054f8cd8d18457d985257
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.