mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0212179293
Summary: > The `buildPropSchema` function in `parsers/typescript/components/props.js` and `parsers/flow/components/props.js` is the same. move it to `parser-commons` and use it in the original files. part of https://github.com/facebook/react-native/issues/34872 - [x] Make the getTypeAnnotation signature from the Flow package to be equal to the typescript one. Specifically, the Typescript one needs an additional parameter withNullDefault that we can safely ignore in the implementation. - [x] buildPropSchema signature can be updated to accept those two functions in input as callbacks. Then, the getProps function can feed the right functions based on the language to the shared build prop schema. ref: https://github.com/facebook/react-native/issues/34872#issuecomment-1517519254 bypass-github-export-checks ## Changelog: <!-- 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 --> [Internal] [Changed] - Use `buildPropSchema` from parser-commons Pull Request resolved: https://github.com/facebook/react-native/pull/37043 Test Plan: - [ ] `yarn jest react-native-codegen` pass Reviewed By: rshest Differential Revision: D45209982 Pulled By: cipolleschi fbshipit-source-id: c241bc0542ba662c965d70d1dc283f48541e14ea
@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 packages/react-native-codegen.