[Android] - TimePicker instant crashing app
See original GitHub issueMy application crashes as soon as I open TimePicker(only on android, iOS works fine). Before everything works fine, but some day just start crashing. I tried already TimePickerAndroid original from react-native and it’s work, there is no app crashing. Please help!!!
My code is:
<DateTimePicker mode="datetime" datePickerModeAndroid={"time"} isVisible={true} onConfirm={this._handleDatePicked} onCancel={this._hideDatePicker} />
Environment: OS: macOS High Sierra 10.13.6 Node: 10.1.0 Yarn: Not Found npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: 3.1 AI-173.4819257
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.4 => 0.55.4
Repo version(I already tried last version, did not help) “react-native-modal-datetime-picker”: “^5.1.0”,
Thanks in advance, kind regards.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Thank you @arthur31416 , I guess it’s just a leftover of an old API change
Hi,
I ran into the same issue when specifying
datePickerModeAndroid="calendar"
, thinking it was the default value. It crashes the app as soon as I change the date.Turns out the default value is not
"calendar"
as specified in the read me but"default"
https://github.com/mmazzarolo/react-native-modal-datetime-picker/blob/6932b8579334b0a5a3bfeaee6366a2e29f15d831/src/CustomDatePickerAndroid/index.js#L22Anyway, the fix is easy: use the actual default value by omitting the
datePickerModeAndroid
prop but I think this is still a bug 😃