-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
Why do i need it? Sometimes i just want to use javascript directly and don't create wrappers to emit events to/from JS to get values.
class SimpleApp extends React.Component {
render() {
return (
...view
)
}
validate(data) {
return -100;
}
}
For example, i would like to get value from 'SimpleApp.prototype.validate'. Just want to call it directly.
In my case, i have one bundle with visuals and some functions that has no any connection to visual part. Right now we have only:
React.AppRegistry.registerRunnable('validate', function(data) { return -100; });
and call it from objective-c:
[_bridge enqueueJSCall:@"AppRegistry.runApplication" args:@[@"validate", @[@2, @2]]]
But current implementation does not allow to get value from js. So my question again - is it possible to get JSContext to do next:
JSValue *validator = context[@"SimpleApp.prototype.validate"];
JSValue *result = [validator callWithArguments:@[@5] ];
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.