Skip to content

Commit

Permalink
Suppress spurious warning about RCTCxxModule (#19880)
Browse files Browse the repository at this point in the history
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue.

Fixes #14806 .

This supersedes PR #19794 .

Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change.

[IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported"
Closes facebook/react-native#19880

Differential Revision: D8653809

Pulled By: hramos

fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
  • Loading branch information
douglowder authored and aleclarson committed Feb 27, 2019
1 parent 5e5cea3 commit d59013e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions React/Base/RCTBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ void RCTVerifyAllModulesExported(NSArray *extraModules)

for (unsigned int i = 0; i < classCount; i++) {
Class cls = classes[i];
if (strncmp(class_getName(cls), "RCTCxxModule", strlen("RCTCxxModule")) == 0) {
continue;
}
Class superclass = cls;
while (superclass) {
if (class_conformsToProtocol(superclass, @protocol(RCTBridgeModule))) {
Expand Down

0 comments on commit d59013e

Please sign in to comment.