Passing a callback to JS function in Static Hermes #1269
luboslenco
started this conversation in
Static Hermes
Replies: 1 comment
-
Hi @luboslenco, that's a great question. Support for JS callbacks is planned (we have some unpublished code for it), but is not currently possible directly (I believe it can still be emulated using JSI). To execute, every JS function needs two pieces of context:
These are automatically passed around in JS, but when calling from native, they need to come from somewhere. In JSI parlance, the former is These are the steps to achieve this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is there a way to pass a JS function to C function? Afterwards I would like to call this JS function from C.
Right now this will result in
error: ft: function parameter 'callback' type mismatch
.Beta Was this translation helpful? Give feedback.
All reactions