Skip to content

PlatformColor and DynamicColorIOS don't work with the New Architecture on iOS #42006

Description

@gabrieldonadel

Description

There are two regressions related to colors on the new arch on iOS

  1. DynamicColorIOS doesn't work at all
  2. PlatformColor only works for the initial color scheme and does not update when the user switches between appearances

Steps to reproduce

  1. Enable the new architecture on your iOS project
  2. Try using DynamicColorIOS or PlatformColor and switching between light mode and dark mode
<View>
<Text style={{color: PlatformColor('labelColor')}}>TEST</Text>
<Text
style={{
color: DynamicColorIOS({
dark: '#FF0000',
light: '#00F000',
}),
}}>
TEST
</Text>
</View>

React Native Version

0.73.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
OS: macOS 14.0
CPU: (12) arm64 Apple M2 Max
Memory: 213.67 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.18.2
path: ~/.volta/tools/image/node/18.18.2/bin/node
Yarn:
version: 1.22.19
path: ~/.volta/tools/image/yarn/1.22.19/bin/yarn
npm:
version: 9.8.1
path: ~/.volta/tools/image/node/18.18.2/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.13.0
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "22"
- "26"
- "30"
- "31"
- "33"
- "34"
Build Tools:
- 26.0.3
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
System Images:
- android-22 | ARM 64 v8a
- android-26 | Google APIs Intel x86_64 Atom
- android-30 | ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10811636
Xcode:
version: 15.2/15C5500c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.8
path: /usr/bin/javac
Ruby:
version: 2.7.8
path: /Users/gabriel/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.1
wanted: 0.73.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: true

Stacktrace or Logs

No relevant logs are generated

Reproducer

https://github.com/gabrieldonadel/rn-073-platform-color-bug

Screenshots and Videos

Screen.Recording.2023-12-20.at.01.02.41.mov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions