UNPKG

793 Btext/x-cView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#include <react/uimanager/ComponentDescriptorFactory.h>
9#include <react/uimanager/ComponentDescriptorRegistry.h>
10#include <react/uimanager/ContextContainer.h>
11
12namespace facebook {
13namespace react {
14
15/**
16 * This is a sample implementation. Each app should provide its own.
17 */
18ComponentRegistryFactory getDefaultComponentRegistryFactory() {
19 return [](const SharedEventDispatcher &eventDispatcher,
20 const SharedContextContainer &contextContainer) {
21 auto registry = std::make_shared<ComponentDescriptorRegistry>();
22 return registry;
23 }
24}
25
26} // namespace react
27} // namespace facebook