mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
b7fc5867f2
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44631 Changelog: [General][Breaking] Use hasteModuleName for C++ Turbo Module enums This is a follow up to https://github.com/facebook/react-native/pull/44630 This changes the names of C++ Turbo Modules enums to use the `hasteModuleName`. Example: `NativeMyAbcModule.js` with this spec: ``` export enum EnumNone { NA, NB, } export interface Spec extends TurboModule { +getStrEnum: (arg: EnumNone) => EnumStr;t } export default (TurboModuleRegistry.get<Spec>('MyAbcModuleCxx'): ?Spec); ``` Before now we generated a base C++ struct with the name: ``` MyAbcModuleCxxEnumNone ^^^ ``` Now the generate name is: ``` NativeMyAbcModuleEnumNone ^^^^^^ ``` ## Changes: - No `Cxx` injected anymore - Ensure base struct is `Native` prefixed (all RN JS TM specs start with it) Reviewed By: cipolleschi Differential Revision: D57602082 fbshipit-source-id: 9ebd68b8059dfbc6e2ec11065915cf049aa3cb0b
@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.