Skip to content

DynamicColorIOS not working anymore with react-native 0.65.1 #7247

@magrinj

Description

@magrinj

🐛 Bug Report

Using DynamicColorIOS inside Navigation.setDefaultOptions break after upgrading to react-native 0.65.1.

It seams fo happen since 0.65.0 as some changes has been made on DynamicColorIOS to add highContrast feature.

https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#ios-specific-1
react/react-native@4b9d9dd

Everything was working properly on react-native 0.64.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Put some DynamicColorIOS inside Navigation.setDefaultOptions

Expected behavior

No error thrown working properly.

Actual Behavior

The following error is thrown:

JSON value 'NoColor' of type NSString cannot be converted to a UIColor. Did you forget to call processColor() on the JS side?
JSON value '{
    dynamic =     {
        dark = NoColor;
        light = NoColor;
    };
}' of type NSMutableDictionary cannot be converted to a UIColor. Expected an iOS dynamic appearance aware color.

Your Environment

  • React Native Navigation version: 7.19.1
  • React Native version: 0.65.1
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator - Debug

Reproducible Demo

Navigation.setDefaultOptions({
    layout: {
      componentBackgroundColor: DynamicColorIOS({dark: 'black', light: 'white'}),
    },
);

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️   Yes, I have the time, but I don't know how to start. I would need guidance.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions