Skip to content

Commit dc41f39

Browse files
hryhoriiK97claude
andcommitted
Give NativeProps_DEPRECATED a constructor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9c943fa commit dc41f39

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ class ShadowNodeFamily final : public jsi::NativeState {
124124
void dispatchRawState(StateUpdate &&stateUpdate, EventQueue::UpdateMode updateMode);
125125

126126
struct NativeProps_DEPRECATED {
127+
explicit NativeProps_DEPRECATED(folly::dynamic props) : props(std::move(props)) {}
128+
127129
folly::dynamic props;
128130

129131
/*
130132
* The props of a shadow node that already include `props`, so that
131133
* cloning that node doesn't apply them again.
132134
*/
133-
std::shared_ptr<const Props> appliedProps;
135+
std::shared_ptr<const Props> appliedProps = nullptr;
134136
};
135137

136138
/*

‎packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,10 @@ std::shared_ptr<ShadowNode> UIManager::cloneNode(
147147
// The result of this operation is the new `nativeProps_DEPRECATED`.
148148
family.nativeProps_DEPRECATED =
149149
std::make_unique<ShadowNodeFamily::NativeProps_DEPRECATED>(
150-
ShadowNodeFamily::NativeProps_DEPRECATED{
151-
.props = mergeDynamicProps(
152-
family.nativeProps_DEPRECATED->props, // source
153-
(folly::dynamic)rawProps, // patch
154-
NullValueStrategy::Ignore)});
150+
mergeDynamicProps(
151+
family.nativeProps_DEPRECATED->props, // source
152+
(folly::dynamic)rawProps, // patch
153+
NullValueStrategy::Ignore));
155154

156155
// 2. Compute the final set of props.
157156
//
@@ -474,16 +473,14 @@ void UIManager::setNativeProps_DEPRECATED(
474473
// `rawProps` overrides what was previously in `nativeProps_DEPRECATED`.
475474
family.nativeProps_DEPRECATED =
476475
std::make_unique<ShadowNodeFamily::NativeProps_DEPRECATED>(
477-
ShadowNodeFamily::NativeProps_DEPRECATED{
478-
.props = mergeDynamicProps(
479-
family.nativeProps_DEPRECATED->props,
480-
(folly::dynamic)rawProps,
481-
NullValueStrategy::Override)});
476+
mergeDynamicProps(
477+
family.nativeProps_DEPRECATED->props,
478+
(folly::dynamic)rawProps,
479+
NullValueStrategy::Override));
482480
} else {
483481
family.nativeProps_DEPRECATED =
484482
std::make_unique<ShadowNodeFamily::NativeProps_DEPRECATED>(
485-
ShadowNodeFamily::NativeProps_DEPRECATED{
486-
.props = (folly::dynamic)rawProps});
483+
(folly::dynamic)rawProps);
487484
}
488485
}
489486

0 commit comments

Comments
 (0)