mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
825492b199
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
@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 packages/react-native-codegen.