Files
react-native/packages/react-native-codegen
Christoph Purrer 65aee6cd77 Add centralized ReservedPrimitiveTypes registry and shared toSafeIdentifier helper (#56049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56049

Reduce duplication and inconsistency across codegen generators by centralizing reserved primitive type mappings into a single `ReservedPrimitiveTypes.js` registry, making future type support and fixes a single-source change and lowering bug risk.

Additionally, standardize identifier capitalization via a shared `toSafeIdentifier` helper in `Utils.js` to prevent divergent string handling across C++/Java helpers.

Also removes dead TODO comments and obsolete commented-out code from `RNCodegen.js`, `GenerateModuleH.js`, and parser files.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D95711348

fbshipit-source-id: 3f541f91f8dcc21e8e8b75cf2f0e402807d18f8a
2026-03-20 19:42:06 -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 packages/react-native-codegen.