question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PlatformColor and DynamicColorIOS don't work

See original GitHub issue

#930 Bug

React Native 0.63 has PlatformColor and DynamicColorIOS color modes (see https://medium.com/@jacobp100/dark-mode-in-react-native-a4ac55a2a0e5)

I tried setting it on fill, color and tintColor using one of these. However, these new colors don’t work

Unexpected behavior

Explained above

Environment info

Run react-native info in your terminal and copy the results here. Also, include the precise version number of this library that you are using in the project

React native info output:

System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i5-7287U CPU @ 3.30GHz
    Memory: 807.58 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.3.0 - /usr/local/bin/node
    Yarn: 1.19.2 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/jacobparker/.rvm/gems/ruby-2.4.5/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 25, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_232 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.0-rc.1 => 0.63.0-rc.1 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 12.1.0

Steps To Reproduce

No expo link due to requiring RN 0.63

Short, Self Contained, Correct (Compilable), Example

No expo link due to requiring RN 0.63

Extra Info

I think tintColor should be easy to support on iOS. RCTConvert handles the new color styles, so I think we just need to remove the JS logic here. Android shouldn’t be too much harder

I suspect handling this for stuff like fill will be harder

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:6

github_iconTop GitHub Comments

1reaction
jacobp100commented, Sep 28, 2020

iamandiradu

I think that return type is expected. You can import { useColorScheme } from 'react-native' if you need to read the current value of dark mode.

1reaction
Guuzcommented, Aug 3, 2020

Please don’t close this Mr. Stale Bot 😉 I would like to know if this is considered a bug and will be fixed or if this will stay this way so we know how to deal with this in our code-base.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PlatformColor and DynamicColorIOS don't work #1391 - GitHub
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity...
Read more >
PlatformColor - React Native
You can use the PlatformColor function to access native colors on the target platform by supplying the native color's corresponding string ...
Read more >
React Native 0.63 preview - Pressable, PlatformColor, and ...
React Native 0.63 was released this morning and it introduces the new Pressable component that was announced last month! The Pressable component is...
Read more >
Color In React Native: Everything You Need to Know - Waldo
Learn about the two APIs for color, PlatformColor and DynamicColorIOS, to be able to implement color in mobile apps via React Native.
Read more >
What's new in React Native v 0.63 - Dev Genius
Native Colors (PlatformColor, DynamicColorIOS), Pressable, LogBox. ... Also Pressable maintains the state of the components; so you don't have to maintain ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found