mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
54fc62cda7
Summary: Part of https://github.com/facebook/react-native/issues/34872 This PR: - extracts the content of the case 'NumberTypeAnnotation' ([Flow](https://github.com/facebook/react-native/blob/b444f0e44e0d8670139acea5f14c2de32c5e2ddc/packages/react-native-codegen/src/parsers/flow/modules/index.js#L370-L372), [TypeScript](https://github.com/facebook/react-native/blob/00b795642a6562fb52d6df12e367b84674994623/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L405-L407)) into a single emitNumber function in the parsers-primitives.js file, and uses the new function in the parsers - unit tests emitNumber function ## Changelog [Internal] [Changed] - Extract contents of the case 'NumberTypeAnnotation' into a single emitNumber function Pull Request resolved: https://github.com/facebook/react-native/pull/34908 Test Plan: ` yarn jest react-native-codegen` <img width="935" alt="image" src="https://user-images.githubusercontent.com/19575877/194764122-44975a97-3acd-4f27-babe-ddcd58c3ec61.png"> Reviewed By: cipolleschi Differential Revision: D40214542 Pulled By: cipolleschi fbshipit-source-id: a7746d3f1dd5f127dc520c6156383b18e00281ec
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.