Files
react-native/ReactAndroid/src/main/jni/react/fabric/CppComponentRegistry.cpp
T
David Vacca ee437bf904 Delete isRootComponent method
Summary:
Delete isRootComponent method, since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638887

fbshipit-source-id: d1d58e07684cb8fd0fc48cfa1f3f92434c1d14c4
2022-12-10 10:30:47 -08:00

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