From ce99a08b6def7eaf284ed7109e502e2072d029ea Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:22:58 -0800 Subject: [PATCH] Fix issue when calling arrange on an RN Island during load (#14362) * Fix issue when calling arrange on an RN Island during load * Change files --------- Co-authored-by: Tatiana Kapos --- ...ative-windows-b14f249c-ae04-440c-97dc-bf0831e5d537.json | 7 +++++++ .../Fabric/Composition/ReactNativeIsland.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 change/react-native-windows-b14f249c-ae04-440c-97dc-bf0831e5d537.json diff --git a/change/react-native-windows-b14f249c-ae04-440c-97dc-bf0831e5d537.json b/change/react-native-windows-b14f249c-ae04-440c-97dc-bf0831e5d537.json new file mode 100644 index 00000000000..5cc50173014 --- /dev/null +++ b/change/react-native-windows-b14f249c-ae04-440c-97dc-bf0831e5d537.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix issue when calling arrange on an RN Island during load", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp index e43b34901bb..24cbc1b8542 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp @@ -778,7 +778,7 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure( facebook::react::LayoutConstraints constraints; ApplyConstraints(layoutConstraints, constraints); - if (m_isInitialized && m_rootTag != -1) { + if (m_isInitialized && m_rootTag != -1 && m_hasRenderedVisual) { if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties( winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) { facebook::react::LayoutContext context; @@ -809,7 +809,7 @@ void ReactNativeIsland::Arrange( facebook::react::LayoutConstraints fbLayoutConstraints; ApplyConstraints(layoutConstraints, fbLayoutConstraints); - if (m_isInitialized && m_rootTag != -1 && !m_isFragment) { + if (m_isInitialized && m_rootTag != -1 && !m_isFragment && m_hasRenderedVisual) { if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties( winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) { facebook::react::LayoutContext context;