From 23bc4a7a2281eada0f71b7d27ad83fe29e367e56 Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:59:29 -0700 Subject: [PATCH 1/3] [Fabric] Realign our AbiComponentDescriptors with core's --- .../Fabric/AbiComponentDescriptor.cpp | 7 +++---- .../Fabric/AbiViewComponentDescriptor.cpp | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp index 00d808d7905..fe54bdcb114 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp @@ -59,6 +59,7 @@ facebook::react::ShadowNode::Unshared AbiComponentDescriptor::cloneShadowNode( const facebook::react::ShadowNode &sourceShadowNode, const facebook::react::ShadowNodeFragment &fragment) const { auto shadowNode = std::make_shared(sourceShadowNode, fragment); + sourceShadowNode.transferRuntimeShadowNodeReference(shadowNode, fragment); shadowNode->Proxy(winrt::make(shadowNode)); winrt::get_self(m_builder) @@ -89,10 +90,8 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps( return ShadowNodeT::defaultSharedProps(); } - if constexpr (std::is_base_of_v) { - if (facebook::react::CoreFeatures::excludeYogaFromRawProps) { - rawProps.filterYogaStylePropsInDynamicConversion(); - } + if constexpr (RawPropsFilterable) { + ShadowNodeT::filterRawProps(rawProps); } rawProps.parse(rawPropsParser_); diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp index 1c8ffc99762..573291baf89 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp @@ -46,6 +46,7 @@ std::shared_ptr AbiViewComponentDescriptor::createS const facebook::react::ShadowNodeFragment &fragment, facebook::react::ShadowNodeFamily::Shared const &family) const { auto shadowNode = std::make_shared(fragment, family, getTraits()); + sourceShadowNode.transferRuntimeShadowNodeReference(shadowNode, fragment); shadowNode->Proxy(winrt::make(shadowNode)); winrt::get_self(m_builder) From c5b2f49f34a2141516a84193fa98fa6803de807b Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:59:38 -0700 Subject: [PATCH 2/3] Change files --- ...ative-windows-9081e071-efb6-42dd-819d-ea225f04f77e.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-9081e071-efb6-42dd-819d-ea225f04f77e.json diff --git a/change/react-native-windows-9081e071-efb6-42dd-819d-ea225f04f77e.json b/change/react-native-windows-9081e071-efb6-42dd-819d-ea225f04f77e.json new file mode 100644 index 00000000000..4e9cff57e31 --- /dev/null +++ b/change/react-native-windows-9081e071-efb6-42dd-819d-ea225f04f77e.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "[Fabric] Realign our AbiComponentDescriptors with core's", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} From d095267432e8bf6b7de385e3d04cc5f92542de35 Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:51:32 -0700 Subject: [PATCH 3/3] fix --- vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp index fe54bdcb114..1f899359a75 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp @@ -90,7 +90,7 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps( return ShadowNodeT::defaultSharedProps(); } - if constexpr (RawPropsFilterable) { + if constexpr (facebook::react::RawPropsFilterable) { ShadowNodeT::filterRawProps(rawProps); }