diff --git a/ReactCommon/fabric/uimanager/ContextContainer.h b/ReactCommon/fabric/uimanager/ContextContainer.h index d1a56454d3f..0b76b861be9 100644 --- a/ReactCommon/fabric/uimanager/ContextContainer.h +++ b/ReactCommon/fabric/uimanager/ContextContainer.h @@ -7,9 +7,11 @@ #include #include +#include #include #include #include +#include namespace facebook { namespace react { @@ -31,7 +33,7 @@ public: * by `{type, key}` pair. */ template - void registerInstance(const T &instance, const std::string &key = "") { + void registerInstance(const T &instance, const std::string &key = {}) { std::lock_guard lock(mutex_); instances_.insert({ @@ -46,7 +48,7 @@ public: * by {type, key} pair. */ template - T getInstance(const std::string &key = "") const { + T getInstance(const std::string &key = {}) const { std::lock_guard lock(mutex_); return *std::static_pointer_cast(instances_.at({std::type_index(typeid(T)), key}));