Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,4 @@ const State::Shared& ShadowNodeFragment::statePlaceholder() {
return instance;
}

using Value = ShadowNodeFragment::Value;

Value::Value(const ShadowNodeFragment& fragment)
: props(fragment.props),
children(fragment.children),
state(fragment.state) {}

Value::operator ShadowNodeFragment() const {
return ShadowNodeFragment{props, children, state};
}

} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ namespace facebook::react {
* Note: Most of the fields are `const &` references (essentially just raw
* pointers) which means that the Fragment does not copy/store them nor
* retain ownership of them.
* Use `ShadowNodeFragment::Value` (see below) to create an owning copy of the
* fragment content to store or pass the data asynchronously.
*/
struct ShadowNodeFragment {
const Props::Shared& props = propsPlaceholder();
Expand All @@ -37,28 +35,6 @@ struct ShadowNodeFragment {
static const Props::Shared& propsPlaceholder();
static const ShadowNode::SharedListOfShared& childrenPlaceholder();
static const State::Shared& statePlaceholder();

/*
* `ShadowNodeFragment` is not owning data-structure, it only stores raw
* pointers to the data. `ShadowNodeFragment::Value` is a convenient owning
* counterpart of that.
*/
class Value final {
public:
/*
* Creates an object with given `ShadowNodeFragment`.
*/
Value(const ShadowNodeFragment& fragment);

/*
* Creates a `ShadowNodeFragment` from the object.
*/
explicit operator ShadowNodeFragment() const;

Props::Shared props;
ShadowNode::SharedListOfShared children;
State::Shared state;
};
};

} // namespace facebook::react