Files
react-native/packages/react-native-codegen
Zihan Chen (MSFT) ae1d54bc5a Add TSMethodSignature to react-native-codegen (#35311)
Summary:
Refering to "Support function signature along with function type properties in commands" in https://github.com/facebook/react-native/issues/34872

Many TypeScript programmers prefer `{ name(arg:string):void; }` to `{ readonly name:(arg:string)=>void; }`.

In this pull request, I updated test cases in both commands and modules to cover it, with missing implementation.

Command arguments are `NamedShape<T>` but the `optional` field is missing, it is also fixed.

## Changelog

[General] [Changed] - Add `TSMethodSignature` to react-native-codegen

Pull Request resolved: https://github.com/facebook/react-native/pull/35311

Test Plan: `yarn jest react-native-codegen` passed

Reviewed By: rshest

Differential Revision: D41217482

Pulled By: cipolleschi

fbshipit-source-id: 480af118d09b022bae919c5391547fd82c1a7cc9
2022-11-14 08:01:20 -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.