question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bridge] RCT_EXPORT_METHOD for instance methods, rather than class methods

See original GitHub issue

I have an RN View that can tell me whenever a button is pressed. However, I want to link this information back to the current state of the ViewController instance. How can this be done?

The only way I can think of is through listening out for NSNotifications as well as emitting them from the exported methods.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
alpercommented, Feb 22, 2016

I don’t understand. Does RCT_EXPORT_METHOD only work on class methods or only on instance methods (and does it call the default init constructor itself)? I’m trying to create a Swift object over on the javascript side by calling init but that dies.

0reactions
johndanekcommented, Nov 10, 2017

@paramaggarwal Does this functionality still exist? My subclass of RCTViewManager has self.bridge, but no self.bridge.uiManager. I need to call addUIBlock. How can this be achieved in React native 0.49.1?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Bridge - exporting one function in another file in ...
So, my concern is that if I change getImageForIcon from an instance method to a class method, won't that cause other issues in...
Read more >
Bridging in React Native by Tadeu Zagallo
This whole setup is only to provide information to the bridge, so it can find everything that was exported, modules and methods, but...
Read more >
Native Modules · React Native - API Manual
The return type of bridge methods is always void . React Native bridge is asynchronous, so the only way to pass a result...
Read more >
iOS Native Modules
React Native will not expose any methods in a native module to ... Instead, you can do the argument conversion within the method...
Read more >
Swift in React Native - The Ultimate Guide Part 1: Modules
Next, you have to expose your Swift class to React Native. ... expose native classes if you don't expose some of their methods,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found