Files
react-native/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h
T
Samuel Susla 1187720e2f ComponentDescriptor::adopt now accepts reference to ShadowNode (#39354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39354

changelog: [internal]

Changes `ComponentDescriptor::adopt` to not be protected and it now accepts ShadowNode reference rather than shared_ptr.

Reviewed By: javache

Differential Revision: D49054000

fbshipit-source-id: 7aa8201277d6ef4046af45fd43360fa7af3b7d44
2023-09-12 04:39:54 -07:00

37 lines
1.1 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.
*/
#pragma once
#include <react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
namespace facebook::react {
class LegacyViewManagerInteropComponentDescriptor final
: public ConcreteComponentDescriptor<LegacyViewManagerInteropShadowNode> {
public:
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
LegacyViewManagerInteropComponentDescriptor(
const ComponentDescriptorParameters& parameters);
/*
* Returns `name` and `handle` based on a `flavor`, not on static data from
* `LegacyViewManagerInteropShadowNode`.
*/
ComponentHandle getComponentHandle() const override;
ComponentName getComponentName() const override;
protected:
void adopt(ShadowNode& shadowNode) const override;
private:
const std::shared_ptr<void> _coordinator;
};
} // namespace facebook::react