-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix Host Function #1844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Host Function #1844
Conversation
@@ -239,8 +250,10 @@ jsi::Value ShareableValue::toJSValue(jsi::Runtime &rt) { | |||
} | |||
case ValueType::HostFunctionType: { | |||
auto hostFunctionWrapper = ValueWrapper::asHostFunctionWrapper(valueContainer); | |||
if (hostFunctionWrapper->hostRuntime == &rt) { | |||
auto hostRuntime = hostFunctionWrapper->value->hostRuntime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use here auto &
instead of auto
to avoid unnecessary copying of objects.
You made my day 🔥 Looking forward to examples and new release 🤩 |
## Description Method `std::shared_ptr<jsi::Function> get()` from `struct HostFunctionHandler : jsi::HostObject` had name conflict wtih `virtual Value get(Runtime&, const PropNameID& name)` from `jsi::HostObject` and this crashed CI and compilation for android. Related with: #1844 ## Checklist - [x] Ensured that CI passes
Hi, is this pr included in v2.0.1? Looks like the problem is still continue. |
Hi, I am following issue for my package. It is solved with v2.1.0 actually. When I try it on Expo project with same version (v2.1.0), problem still exist. Not sure if I open an issue in Expo. Wanted to let you know. |
Description
Fixes: #1758
Currently, when we send callback function to UI thread and then back to RN then we will get function wrapper that checks is somebody uses runOnJS. In order to solve the problem, I've added logic that attaches additional info to a function wrapper that allows to get original callback.
Changes
Test code and steps to reproduce
Checklist