Files
react-native/packages/react-native-codegen
Eli White 825492b199 Separate component array types and command array types (#48474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48474

The previous definition said that you could put prop types into commands, which definitely isn't allowed.

For example, the schema would have allowed `WithDefault` types.

```
interface NativeCommands {
  +methodInt: (viewRef: React.ElementRef<NativeType>, a: WithDefault<string, 'hi'>) => void;
}
```

This change separates out the things that are allowed in commands from what's allowed in props.

Commands should be very similar to what's allowed in native modules, but it isn't exact enough to be able to merge those.

## Changelog:
[General][Breaking] - Codegen: Separate component array types and command array types

Reviewed By: cipolleschi

Differential Revision: D67806818

fbshipit-source-id: 58e504fe2e2e5efa612e836b18af22a167e7ae2f
2025-01-06 18:42:37 -08: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 packages/react-native-codegen.