Skip to content

Commit a3379d1

Browse files
committed
Fix bool operator on transparent colors returning false (microsoft#14413)
* Fix crash loading logbox * Fix bool operator on transparent colors returning false * Change files * format
1 parent 3b38118 commit a3379d1

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fix bool operator on transparent colors returning false",
4+
"packageName": "react-native-windows",
5+
"email": "30809111+acoates-ms@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,10 @@ ReactNativeIsland::GetComponentView() noexcept {
972972

973973
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
974974
winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
975-
auto rootComponentViewDescriptor = fabricuiManager->GetViewRegistry().componentViewDescriptorWithTag(
976-
static_cast<facebook::react::SurfaceId>(m_rootTag));
977-
return rootComponentViewDescriptor.view
978-
.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
975+
if (auto view = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
976+
static_cast<facebook::react::SurfaceId>(m_rootTag))) {
977+
return view.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
978+
}
979979
}
980980
return nullptr;
981981
}

vnext/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ struct Color {
3838
};
3939

4040
namespace HostPlatformColor {
41-
static const facebook::react::Color UndefinedColor{{0, 0, 0, 0} /*Black*/, {} /*Empty PlatformColors*/};
41+
static const facebook::react::Color UndefinedColor{
42+
{0, 0, 0, 0} /*Black*/,
43+
{"__undefinedColor"} /*Empty PlatformColors*/};
4244
} // namespace HostPlatformColor
4345

4446
inline Color hostPlatformColorFromComponents(ColorComponents components) {

0 commit comments

Comments
 (0)