mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
46b6453eb6
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44005 When using frameworks on iOS, there is a possibility that modules import the Spec.h file twice and this might end up in a Redefinition of some symbols and duplication of symbols which ends up in build errors, as reported here: https://github.com/facebook/react-native/issues/42670. This change adds some [`#include guards`](https://en.wikipedia.org/wiki/Include_guard) in codegen to avoid the redefinition of those symbols if the header is imported/included multiple times. Note: I also experimented with `#pragma once`, but it looks like Apple is not happy with that directive. [It seems](https://forums.developer.apple.com/forums/thread/739964) that it started working flakely from Xcode 15. ## Changelog: [General][Fixed] - Make sure that we can't include Codegen symbols multiple times Reviewed By: cortinico Differential Revision: D55925605 fbshipit-source-id: 15ca076aace2ffbd03ab8fa8a68a3d8ce0d1ea65
@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.