mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-09 13:37:58 +08:00
Summary: That allows avoiding circular deps and unnecessary deps on uimanager module. Reviewed By: PeteTheHeat Differential Revision: D14917227 fbshipit-source-id: fe7962ee528aa659d8bd23e3e46627722551d995
28 lines
792 B
C++
28 lines
792 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 SharedContextContainer &contextContainer) {
|
|
auto registry = std::make_shared<ComponentDescriptorRegistry>();
|
|
return registry;
|
|
};
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|