mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
edc4ea0a67
Summary: Part of https://github.com/facebook/react-native/issues/34872: > Update the [IncorrectlyParameterizedGenericParserError](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/errors.js#L134) error in the error.js file to accept a Parser instead of a ParserType parameter. Use the nameForGenericTypeAnnotation method of the parser to extract the genericName and delete the ternary operator. Since the task was added to the issue we split the IncorrectlyParameterizedGenericParserError into 2 errors: MissingTypeParameterGenericParserError and MissingTypeParameterGenericParserError (https://github.com/facebook/react-native/pull/35134/), so I applied the change on both errors. ## 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] - Use parser instead of language in MissingTypeParameterGenericParserError and MoreThanOneTypeParameterGenericParserError Pull Request resolved: https://github.com/facebook/react-native/pull/35294 Test Plan: I tested using Flow and Jest commands. More specifically, the tests that cover this change are the ones I renamed. Reviewed By: christophpurrer Differential Revision: D41181069 Pulled By: cipolleschi fbshipit-source-id: 3412e29b1319a28b3ec6afb38b1eda448055fa6a
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.