Is this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v: 0.45.1 / cli 2.0.1node -v: v7.9.0npm -v: 5.0.3yarn --version (if you use Yarn): 0.24.6
Then, specify:
- Target Platform: iOS
- Development Operating System: macOS Sierra
- Build tools: any supported Xcode version, any supported iOS version
Steps to Reproduce
- Execute
react-native init testproject - Open the Xcode project and hit run
Expected Behavior
No warnings should be logged to the Xcode console since we have the default setup.
Actual Behavior
In the Xcode log there is a warning about the RCTCxxModule not being exported:
2017-07-03 11:09:47.963 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-07-03 11:09:47.963285+0200 testproject[467:119661] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
Reproducible Demo
Any newly created React-Native project using the CxxBridge has this issue.
Possible solution
The RCTVerifyAllModulesExported function uses the objc_copyClassList which also reports the RCTCxxModule. This triggers the warning that this module is not exported, but since the RCTCxxModule is merely a base class that can be used by real module implementation this is a false positive.
A possible solution would be to make an exception in RCTVerifyAllModulesExported for the RCTCxxModule so it will not be checked and the warning will not be produced.
Note: The warning will disappear when you create a module that subclasses RCTCxxModule since there is a check in place for that scenario. As long as there is no subclass yet this warning will pop up.
Is this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v: 0.45.1 / cli 2.0.1node -v: v7.9.0npm -v: 5.0.3yarn --version(if you use Yarn): 0.24.6Then, specify:
Steps to Reproduce
react-native init testprojectExpected Behavior
No warnings should be logged to the Xcode console since we have the default setup.
Actual Behavior
In the Xcode log there is a warning about the
RCTCxxModulenot being exported:Reproducible Demo
Any newly created React-Native project using the CxxBridge has this issue.
Possible solution
The
RCTVerifyAllModulesExportedfunction uses theobjc_copyClassListwhich also reports theRCTCxxModule. This triggers the warning that this module is not exported, but since theRCTCxxModuleis merely a base class that can be used by real module implementation this is a false positive.A possible solution would be to make an exception in
RCTVerifyAllModulesExportedfor theRCTCxxModuleso it will not be checked and the warning will not be produced.Note: The warning will disappear when you create a module that subclasses
RCTCxxModulesince there is a check in place for that scenario. As long as there is no subclass yet this warning will pop up.