mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 09:21:44 +08:00
Expose the bridge instance to CxxModule via a weak_ptr
Summary: In order for `CxxModule` modules to be able to do things like emit events, we need to expose the bridge instance. To allow classes derived from `CxxModule` in other projects to include `<cxxreact/Instance.h> I also needed to convert all the header includes to non-relative ones. Reviewed By: javache Differential Revision: D4564145 fbshipit-source-id: a5bc28dd9b40e2b141af9e867105c56083fbdcdc
This commit is contained in:
committed by
Facebook Github Bot
parent
f9df89ac95
commit
c38d56d9db
@@ -50,7 +50,9 @@ CxxNativeModule::CxxNativeModule(std::weak_ptr<Instance> instance,
|
||||
std::unique_ptr<CxxModule> module)
|
||||
: instance_(instance)
|
||||
, module_(std::move(module))
|
||||
, methods_(module_->getMethods()) {}
|
||||
, methods_(module_->getMethods()) {
|
||||
module_->setInstance(instance);
|
||||
}
|
||||
|
||||
std::string CxxNativeModule::getName() {
|
||||
return module_->getName();
|
||||
|
||||
Reference in New Issue
Block a user