user2702179
user2702179

Reputation: 197

React Native warning: RCTC module not exported

I am getting a warning when running my React Native app on iOS:

Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?

How can I fix this?

Upvotes: 4

Views: 1556

Answers (2)

KAUSHAL J. SATHWARA
KAUSHAL J. SATHWARA

Reputation: 994

Using this no need to import YellowBox. Without any dependency and declaration in header just put:

console.disableYellowBox = true;

this line in the constructor.

 constructor(props) {
       super(props);
       this.state = {           
       }
       console.disableYellowBox = true;
 }

Upvotes: 2

Kirankumar Dafda
Kirankumar Dafda

Reputation: 2384

This occurs with RN 0.55.3 and probably any newer version.

For now it's not the best solution, but to avoid the warning we can ignore it:

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Class RCTCxxModule']);

Upvotes: 8

Related Questions