Skip to content

Commit 7dea848

Browse files
authored
Fix bool operator on transparent colors returning false (#14413)
* Fix crash loading logbox * Fix bool operator on transparent colors returning false * Change files * format
1 parent 74a161e commit 7dea848

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
@@ -979,10 +979,10 @@ ReactNativeIsland::GetComponentView() noexcept {
979979

980980
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
981981
winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
982-
auto rootComponentViewDescriptor = fabricuiManager->GetViewRegistry().componentViewDescriptorWithTag(
983-
static_cast<facebook::react::SurfaceId>(m_rootTag));
984-
return rootComponentViewDescriptor.view
985-
.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
982+
if (auto view = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
983+
static_cast<facebook::react::SurfaceId>(m_rootTag))) {
984+
return view.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
985+
}
986986
}
987987
return nullptr;
988988
}

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)