mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
62544c0830
Summary: * <Image> must be a leaf node; having a proper trait will fail earlier in case of misuse (mounting something inside). * <View> must have a `View` trait because it's for what that trait is. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21028573 fbshipit-source-id: 457716d4661333eb2357f34316f3e495ab4fda24
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its 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/components/view/ConcreteViewShadowNode.h>
|
|
#include <react/components/view/ViewProps.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
extern const char ViewComponentName[];
|
|
|
|
/*
|
|
* `ShadowNode` for <View> component.
|
|
*/
|
|
class ViewShadowNode final : public ConcreteViewShadowNode<
|
|
ViewComponentName,
|
|
ViewProps,
|
|
ViewEventEmitter> {
|
|
public:
|
|
static ShadowNodeTraits BaseTraits() {
|
|
auto traits = BaseShadowNode::BaseTraits();
|
|
traits.set(ShadowNodeTraits::Trait::View);
|
|
return traits;
|
|
}
|
|
|
|
ViewShadowNode(
|
|
ShadowNodeFragment const &fragment,
|
|
ShadowNodeFamily::Shared const &family,
|
|
ShadowNodeTraits traits);
|
|
|
|
ViewShadowNode(
|
|
ShadowNode const &sourceShadowNode,
|
|
ShadowNodeFragment const &fragment);
|
|
|
|
private:
|
|
void initialize() noexcept;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|