Fabric Button does not render anything (due to lack of PlatformColor) #11456
Labels
Area: Button
Area: Fabric
Support Facebook Fabric
Area: PlatformColor
bug
New Architecture
Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
Milestone
Problem Description
Button
relies onPlatformColor
, which isn't specified in Fabric like it is on Paper with named colors (which on Paper map to XAML brushes).I could see this being fixed by:
A) Modifying
Libraries\Components\Button.windows.js
to not usePlatformColor
and specify hardcoded colors(note that this would break light/dark/high-contrast mode for the
Button
component)B) Modify
Microsoft.ReactNative\Fabric\platform\react\renderer\graphics\Color.cpp
to implementAsWindowsColor()
with a look up of appropriate colors.This notion of "appropriate colors" is interesting though, because... what are the right colors?
In order to get
Button
to work, you'd need these:Those names are very derived from XAML, and in a world where RNW doesn't rely on XAML... are those the right "system" colors? Contrast with the FURN Colors. What's the boundary between system color and color palette served by a control library.
Proposal
To get unblocked, just bypass this with specified colors (either in the Button JS or in PlatformColor) that used by any built in components. The problems mentioned above can wait.
Something like this? Needs support for theming thought at some point: #11489
With that fix:
Steps To Reproduce
Button
(it's there, you can click it, but none of it content renders)
Or, view in playground composition:
Expected Results
I can see the button
CLI version
11.0.0-alpha.2
Environment
Target Platform Version
None
Target Device(s)
No response
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: