react-native-hybrid-app-examples icon indicating copy to clipboard operation
react-native-hybrid-app-examples copied to clipboard

RCT_EXPORT_MODULE() gets called but the properties are nil

Open nipun0505 opened this issue 6 years ago • 1 comments

Hi, I was following the "ModalWithNavigatorCoordinator' example. Everything is fine but I cant dismiss the ViewController housing the RCTRootView.

I do get a callback in:

 // This is an exported method that is available in JS.
RCT_EXPORT_METHOD(closeModal) {
  [self.delegate closeModal];
}

but the self.delegate is nil. Also I noticed whenever I execute the call to open my react native component, I get this log:

2018-12-07 18:11:56.157 [info][tid:main][RCTRootView.m:293] Running application MySectionList ({
    initialProps =     {
    };
    rootTag = 1;
})
2018-12-07 18:11:56.157408+0530 ReactNativeTest[31182:518324] Running application MySectionList ({
    initialProps =     {
    };
    rootTag = 1;
})

"ReactNativeTest" is the name of my iOS project and MySectionList is the name of my React-Native project.

nipun0505 avatar Dec 07 '18 12:12 nipun0505

Had the same problem, the only way to avoid it was to save the data to the userdefaults and recover the value in the RCT_EXPORT_METHOD

Neogene avatar May 20 '21 08:05 Neogene