mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d9e7be76cd
commit
ee437bf904
@@ -517,16 +517,6 @@ void Binding::preallocateView(
|
||||
SurfaceId surfaceId,
|
||||
ShadowNode const &shadowNode) {
|
||||
auto name = std::string(shadowNode.getComponentName());
|
||||
|
||||
// Disable preallocation in java for C++ view managers
|
||||
// RootComponents that are implmented as C++ view managers are still
|
||||
// preallocated (this could be avoided by using Portals)
|
||||
if (sharedCppComponentRegistry_ && sharedCppComponentRegistry_.get() &&
|
||||
sharedCppComponentRegistry_->containsComponentManager(name) &&
|
||||
!sharedCppComponentRegistry_->isRootComponent(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto shadowView = ShadowView(shadowNode);
|
||||
auto mountingManager = verifyMountingManager("Binding::preallocateView");
|
||||
if (!mountingManager) {
|
||||
|
||||
@@ -37,15 +37,5 @@ ComponentRegistryResolver::getComponentManager(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ComponentRegistryResolver::isRootComponent(
|
||||
std::string componentName) const {
|
||||
auto iterator = resolverMap_.find(componentName);
|
||||
if (iterator != resolverMap_.end()) {
|
||||
return iterator->second.isRootComponent;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -34,8 +34,6 @@ class ComponentRegistryResolver {
|
||||
|
||||
bool containsComponentManager(std::string componentName) const;
|
||||
|
||||
bool isRootComponent(std::string componentName) const;
|
||||
|
||||
std::shared_ptr<facebook::react::ComponentManager> getComponentManager(
|
||||
std::string name) const;
|
||||
|
||||
|
||||
@@ -42,9 +42,5 @@ CppComponentRegistry::getComponentManager(const std::string &name) const {
|
||||
return componentManagerResolver_.getComponentManager(name);
|
||||
}
|
||||
|
||||
bool CppComponentRegistry::isRootComponent(std::string name) const {
|
||||
return componentManagerResolver_.isRootComponent(name);
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -35,15 +35,11 @@ class CppComponentRegistry : public jni::HybridClass<CppComponentRegistry> {
|
||||
std::function<std::shared_ptr<facebook::react::ComponentManager>(
|
||||
const std::string &name)> f);
|
||||
|
||||
bool isRootComponent(std::string name) const;
|
||||
|
||||
bool containsComponentManager(std::string name) const;
|
||||
|
||||
std::shared_ptr<facebook::react::ComponentManager> getComponentManager(
|
||||
const std::string &name) const;
|
||||
|
||||
void deleteComponentInstance(Tag tag) const;
|
||||
|
||||
private:
|
||||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
|
||||
ComponentRegistryResolver componentManagerResolver_{};
|
||||
|
||||
@@ -324,13 +324,6 @@ void FabricMountingManager::executeMount(
|
||||
if (cppComponentRegistry_->containsComponentManager(name)) {
|
||||
// is this thread safe?
|
||||
cppViewMutations.push_back(mutation);
|
||||
|
||||
// This is a hack that could be avoided by using Portals
|
||||
// Only execute mutations instructions for Root C++ ViewManagers
|
||||
// because Root C++ Components have a Android view counterpart.
|
||||
if (!cppComponentRegistry_->isRootComponent(name)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user