A native component I'm trying to reuse for React Native migration has multiple inheritance. A simplified code is like the following.
public interface INative1
{
void method1();
}
public interface INative2: public INative1
{
void method2();
}
public class Native: public INative2 {}
With this setup, only method2() is projected to JavaScript, and method1() is unavailable. The following code is not traversing up the inheritance chain but only looking through the direct parents. ☹
react-native-winrt-main\rnwinrt\rnwinrt\react\strings\base.cpp
projected_object_instance::projected_object_instance(const winrt::IInspectable& instance) : m_instance(instance)
{
auto iids = winrt::get_interfaces(m_instance); <<<< Getting direct parents.
for (auto&& iid : iids)
{
if (auto iface = find_interface(iid))
{
m_interfaces.push_back(iface); <<<< Not pushing back the ancestors of the direct parent interface.
}
}
}
A native component I'm trying to reuse for React Native migration has multiple inheritance. A simplified code is like the following.
With this setup, only
method2()is projected to JavaScript, andmethod1()is unavailable. The following code is not traversing up the inheritance chain but only looking through the direct parents. ☹