theme not accepting DynamicColorIOS
when used with @react-navigation/bottom-tabs
#10891
Open
3 of 12 tasks
Labels
Current behavior
I want to customize the theme of the React Navigation
NavigationContainer
withDynamicColorIOS
like follows:But I got the error:
The error originated from
@react-navigation/bottom-tabs/src/views/BottomTabItem.tsx
line 196, when making a call to theColor
constructor of the"color"
library, which does not supportDynamicColorIOS
:const inactiveTintColor = customInactiveTintColor === undefined - ? Color(colors.text).mix(Color(colors.card), 0.5).hex() : customInactiveTintColor;
This is the only issue I am encountering but in principle every call to the
Color
methods would be an issue when used with aDynamicColorIOS
.Theoretically an abstraction can be built around
Color
by accessing the inner workings ofDynamicColorIOS
(i.e.{dynamic: {light: string, dark: string}}
), although I don’t know if it is an elegant solution and if the definition ofDynamicColorIOS
might change in the future, breaking this abstraction.Expected behavior
DynamicColorIOS
colors should be allowed to be used fortheme
customization forNavigationContainer
.Reproduction
https://snack.expo.dev/@zhumingcheng697/theme-not-accepting-dynamiccolorios-when-used-with-bottom-tabs
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: