mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fabric: remove LocalData from ShadowNodeFragment
Summary: LocalData isn't used by any components. We've moved towards State. Changelog: [internal] Reviewed By: mdvacca Differential Revision: D19250603 fbshipit-source-id: f95da375117dcb8f6540a6c75d3a80bba630672c
This commit is contained in:
1 parent
55319a3fbb
commit
5a94471650
5 files changed
+1
-18
No files matched your search
@@ -66,9 +66,6 @@ ShadowNode::ShadowNode(
|
||||
props_(fragment.props ? fragment.props : sourceShadowNode.props_),
|
||||
children_(
|
||||
fragment.children ? fragment.children : sourceShadowNode.children_),
|
||||
localData_(
|
||||
fragment.localData ? fragment.localData
|
||||
: sourceShadowNode.localData_),
|
||||
state_(
|
||||
fragment.state ? fragment.state
|
||||
: sourceShadowNode.getMostRecentState()),
|
||||
|
||||
@@ -21,11 +21,6 @@ ShadowNodeFragment::childrenPlaceholder() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
LocalData::Shared const &ShadowNodeFragment::localDataPlaceholder() {
|
||||
static auto &instance = *new LocalData::Shared();
|
||||
return instance;
|
||||
}
|
||||
|
||||
State::Shared const &ShadowNodeFragment::statePlaceholder() {
|
||||
static auto &instance = *new State::Shared();
|
||||
return instance;
|
||||
@@ -36,11 +31,10 @@ using Value = ShadowNodeFragment::Value;
|
||||
Value::Value(ShadowNodeFragment const &fragment)
|
||||
: props_(fragment.props),
|
||||
children_(fragment.children),
|
||||
localData_(fragment.localData),
|
||||
state_(fragment.state) {}
|
||||
|
||||
Value::operator ShadowNodeFragment() const {
|
||||
return ShadowNodeFragment{props_, children_, localData_, state_};
|
||||
return ShadowNodeFragment{props_, children_, state_};
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <react/core/EventEmitter.h>
|
||||
#include <react/core/LocalData.h>
|
||||
#include <react/core/Props.h>
|
||||
#include <react/core/ReactPrimitives.h>
|
||||
#include <react/core/ShadowNode.h>
|
||||
@@ -29,7 +28,6 @@ namespace react {
|
||||
struct ShadowNodeFragment {
|
||||
Props::Shared const &props = propsPlaceholder();
|
||||
ShadowNode::SharedListOfShared const &children = childrenPlaceholder();
|
||||
LocalData::Shared const &localData = localDataPlaceholder();
|
||||
State::Shared const &state = statePlaceholder();
|
||||
|
||||
/*
|
||||
@@ -39,7 +37,6 @@ struct ShadowNodeFragment {
|
||||
*/
|
||||
static Props::Shared const &propsPlaceholder();
|
||||
static ShadowNode::SharedListOfShared const &childrenPlaceholder();
|
||||
static LocalData::Shared const &localDataPlaceholder();
|
||||
static State::Shared const &statePlaceholder();
|
||||
|
||||
/*
|
||||
@@ -62,7 +59,6 @@ struct ShadowNodeFragment {
|
||||
private:
|
||||
Props::Shared const props_;
|
||||
ShadowNode::SharedListOfShared const children_;
|
||||
LocalData::Shared const localData_;
|
||||
State::Shared const state_;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -183,7 +183,6 @@ SharedShadowNode ComponentDescriptorRegistry::createNode(
|
||||
{
|
||||
/* .props = */ props,
|
||||
/* .children = */ ShadowNodeFragment::childrenPlaceholder(),
|
||||
/* .localData = */ ShadowNodeFragment::localDataPlaceholder(),
|
||||
/* .state = */ state,
|
||||
},
|
||||
{tag, surfaceId, eventEmitter});
|
||||
|
||||
@@ -49,7 +49,6 @@ SharedShadowNode UIManager::createNode(
|
||||
props, RawProps(folly::dynamic::object("name", name)))
|
||||
: props,
|
||||
/* .children = */ ShadowNodeFragment::childrenPlaceholder(),
|
||||
/* .localData = */ ShadowNodeFragment::localDataPlaceholder(),
|
||||
/* .state = */ state,
|
||||
},
|
||||
ShadowNodeFamilyFragment{tag, surfaceId, eventEmitter});
|
||||
@@ -209,8 +208,6 @@ void UIManager::updateState(
|
||||
return oldShadowNode.clone({
|
||||
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
|
||||
/* .children = */ ShadowNodeFragment::childrenPlaceholder(),
|
||||
/* .localData = */
|
||||
ShadowNodeFragment::localDataPlaceholder(),
|
||||
/* .state = */ state,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user