mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e547f466ee
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53135 Our Codegenerated components are not generating code for `getDebugProps`. This change modifies Codegen to add those functions for all the codegen components. ## Changelog: [General][Added] - Added getDebugProps to codegen ## Facebook: `getDebugProps` are required by Fantom to write tests. However, we can't generate these function for third party components, because codegen can generate arbitrary structs and we don't have a generic `toString()` method that can be used or automatically generated by C++. By generating this function only for Core Components, we can ensure that we can write Fantom tests without breaking all the users of React Native. Reviewed By: rubennorte Differential Revision: D79805145 fbshipit-source-id: 0e41c65fc30eaa886a05557ca233fb0a9cb18a71
@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.