Files
react-native/packages/react-native-codegen
Antoine Doubovetzky edc4ea0a67 Use parser instead of language in MissingTypeParameterGenericParserError and MoreThanOneTypeParameterGenericParserError (#35294)
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
2022-11-10 10:12:15 -08:00
..
2022-02-22 02:23:02 -08:00
2020-09-29 14:39:40 -07:00

react-native-codegen

Version

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:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest react-native-codegen.