Created
August 17, 2015 13:10
-
-
Save dsibiski/0c746deeb21c96b3a666 to your computer and use it in GitHub Desktop.
Pass a React Native view from JS to Obj-C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RCT_EXPORT_METHOD(doSomething:(NSNumber *)reactTag) | |
{ | |
[_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { | |
UIView *view = viewRegistry[reactTag]; | |
if ([view isKindOfClass:[UIView class]]) { | |
[view doSomething]; | |
} | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment