mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
320e51f4c4
Summary: > [Codegen 100] Create a createComponentConfig function in the parser-commons.js file. It takes the foundConfig and the commandTypeNames as parameters and returns the component config object. Extract the return statements ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L115-L126) [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L116-L127)) and use those implementations in that function. Part of Issue https://github.com/facebook/react-native/issues/34872 In case I should already add better typing I can update the PR while clarifying the type definitions. ## Changelog [INTERNAL] [CHANGED] - Move the return statement of `findComponentConfig` to `parsers-commons.js` merging Flow and TS implementation. Pull Request resolved: https://github.com/facebook/react-native/pull/36446 Test Plan: `yarn lint && yarn run flow && yarn test react-native-codegen` Reviewed By: cortinico Differential Revision: D44005899 Pulled By: rshest fbshipit-source-id: 19a4a05476156cbc2d824c9c32a7909c06a382ff
@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.