React-native-picker-select: useNativeAndroidPickerStyle outside Expo

Created on 15 Jul 2019  路  4Comments  路  Source: lawnstarter/react-native-picker-select

Describe the bug

Using the useNativeAndroidPickerStyle in a react-native-cli project (without Expo) I run into the following error:
screenshot-2019-07-15_14 02 51 68
You can see the exact code that triggers this in this snack

This piece of code works well in an Expo project, but not in a project that does not rely on Expo.

To Reproduce

Changing the value from null to some value, or else from a certain value to null. Strangely enough, changing between different values (e.g: football to baseball) doesn't trigger this error.

Expected behavior

For it work well, as it does in the expo snack.

Smartphone (please complete the following information):

  • Device: Android (both emulator and real device)
  • OS: Android 6 and 8
  • react-native-picker-select version: 6.3.0
  • react-native version: 0.59.9
  • react version: 16.8.3

Reproduction and/or code sample

This snack works well. however, the same code in a react-native-cli project (without expo) fails with the error mentioned before

Any fix would be most helpful.
Thank you.

help wanted

Most helpful comment

this worked for me
style={ { inputAndroid:{color:'black'} } }

All 4 comments

this worked for me
style={ { inputAndroid:{color:'black'} } }

this worked for me
style={ { inputAndroid:{color:'black'} } }

this worked for me too, thanks for the solution.

Will look into this one when I get a moment - we don't use Expo, so this is an odd one.

just ran your expo code on a fresh install of react-native init - works fine. if you can reproduce the error and share a github repo let me know

Was this page helpful?
0 / 5 - 0 ratings