mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Delete isRootComponent method, since it's not necessary anymore changelog: [internal] internal Reviewed By: javache Differential Revision: D41638887 fbshipit-source-id: d1d58e07684cb8fd0fc48cfa1f3f92434c1d14c4
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "CppComponentRegistry.h"
|
|
#include <fbjni/fbjni.h>
|
|
#include <jsi/jsi.h>
|
|
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
|
|
|
using namespace facebook::jsi;
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
jni::local_ref<CppComponentRegistry::jhybriddata>
|
|
CppComponentRegistry::initHybrid(jni::alias_ref<jclass>) {
|
|
return makeCxxInstance();
|
|
}
|
|
|
|
void CppComponentRegistry::registerNatives() {
|
|
registerHybrid(
|
|
{makeNativeMethod("initHybrid", CppComponentRegistry::initHybrid)});
|
|
}
|
|
|
|
void CppComponentRegistry::addComponentManager(
|
|
std::string name,
|
|
bool isRootComponent,
|
|
std::function<std::shared_ptr<facebook::react::ComponentManager>(
|
|
const std::string &name)> f) {
|
|
componentManagerResolver_.addComponentManager(name, isRootComponent, f);
|
|
}
|
|
|
|
bool CppComponentRegistry::containsComponentManager(std::string name) const {
|
|
return componentManagerResolver_.containsComponentManager(name);
|
|
}
|
|
|
|
std::shared_ptr<facebook::react::ComponentManager>
|
|
CppComponentRegistry::getComponentManager(const std::string &name) const {
|
|
return componentManagerResolver_.getComponentManager(name);
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|