mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Summary: So, changes: * Correctness checks only in debug mode (codesize win?); * `registerInstance` marked as const (because it's thread safe); * ContextContainer::Shared also enforces constness; * Using faster better::map; * Using shared/RW mutex instead of regular one; * SharedContextContainer got removed. Reviewed By: sahrens Differential Revision: D14920284 fbshipit-source-id: f0f8d970e7fae79a1abe3bc32827db9fd2d17e13
28 lines
794 B
C++
28 lines
794 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include <react/uimanager/ComponentDescriptorFactory.h>
|
|
#include <react/uimanager/ComponentDescriptorRegistry.h>
|
|
#include <react/utils/ContextContainer.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/**
|
|
* This is a sample implementation. Each app should provide its own.
|
|
*/
|
|
ComponentRegistryFactory getDefaultComponentRegistryFactory() {
|
|
return [](const EventDispatcher::Shared &eventDispatcher,
|
|
const ContextContainer::Shared &contextContainer) {
|
|
auto registry = std::make_shared<ComponentDescriptorRegistry>();
|
|
return registry;
|
|
};
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|