Don't work textColor props.
Expo + datetimepicker (tested on ios)
Library version: 2.3.0
Please take a look a snack - https://snack.expo.io/@nozhenkod/rndatetimepicker-text-color
@sbycrosz, @vonovak Guys, I've seen you created textColor feature recently. Please, take a look.
hello, this module relies on native code (Java, Objective-C). The reason you're getting the bug is that expo SDK bundles a specific version of this module's native code. If you take a look at the docs https://docs.expo.io/versions/latest/sdk/date-time-picker/ and you run the command expo install @react-native-community/datetimepicker as documented, you'll see that version 2.1.0 is installed. The textColor prop, however, was added in 2.3.0. This is why it does not work - the prop is effectively ignored. The support might be added to expo sdk 37, but I'm not related to expo in any way so don't take my word for it. Hope you understand. Don't hesitate to ask more.
Hey guys...I am also having this issue. Don't work textColor props.
I tested datetimepiker (mode="date", textColor="red") on iOS
I have expo SDK 37,
Library _react-native-community/datetimepicker_ version: 2.3.2
@vonovak have any idea?
@vonovak I suppose the problem is not related with expo SDK, I manually update the version of package to 2.3.2 and expo messaged me that a version is not compatible, but continues worked with 2.3.2 version. Which native component do you use as picker? When I used a react-native Picker I had to pass the itemStyle prop with color style manually
@githubroman @Melekhin even though you installed 2.3.2, the native code in expo is from an older version. Native code from >=2.3.2 is needed to support textColor prop. Even though you pass textColor prop, the backing native code is not there. That is why it won't work with expo.
@vonovak but I re-installed dependencies and I think the native code has also updated. Which is native component not updated you suppose?
@githubroman since you're using expo managed workflow, the native code is set into its sdk, you cannot change it. There is just no way to do that - you need to wait for expo 38. I hope it's clear, thank you.
Temporary "fix" for those of you who can't wait untill expo 38(if you have the same issues as me, where the background is white and on some devices the font is white):
`
shadowRadius: 0,
shadowOpacity: 1,
shadowOffset: { height: 0, width: 0 }
}}
/`
style={shadowColor: '#000000', shadowRadius: 0, shadowOpacity: 1, shadowOffset: { height: 0, width: 0 } }}
Thanks for this, better than nothing but this is quite an ugly bug
Thank you @Vachan0, I was going crazy trying to figure out why one user had this issue. Do we have any idea why it is doing this? (the white background / white font issue).
Slow response @bradbumbalough, but it's linked with Dark Mode on iOS. There's a few work-arounds to force Expo to set Apps as "Light" only and avoid the problem, but it appears as though this doesn't work in all scenarios as the datetimepicker uses Modals. Expo 38 is out now, so hopefully people can upgrade and have a cleaner solution now!
... as the datetimepicker uses Modals
just to clarify, datetimepicker does not use any modals
I faced same problem and I added display="spinner" and then I added this prop textColor="#000" to change text color and here the problem happens, so I uninstalled the datetimepicker module using npm uninstall @react-native-community/datetimepicker --save and I install it again then and nothing fixed, so I make a final try by addeding style={{top: 0}} and then the textColor prop work fine.
I hope this help someone
Most helpful comment
Temporary "fix" for those of you who can't wait untill expo 38(if you have the same issues as me, where the background is white and on some devices the font is white):
style={shadowColor: '#000000',
`
shadowRadius: 0,
shadowOpacity: 1,
shadowOffset: { height: 0, width: 0 }
}}