henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.21k stars 338 forks source link

[Android] App crashes on release mode RN 0.73.8 #830

Closed angelinaromashkoo closed 3 months ago

angelinaromashkoo commented 3 months ago

Describe the bug App crashes when displaying the date picker modally only on Android (OS 11) in release mode. We are using react-native version 0.73.8 and the library version 4.3.3. We got this error in AppCenter: com.facebook.react.modules.core.ExceptionsManagerModule.reportException ExceptionsManagerModule.java, line 65 com.facebook.react.common.JavascriptException: TypeError: undefined is not a function This error is located at: in DatePickerAndroid in DatePickerWrapper

Expected behavior App shouldn't crash.

To Reproduce

import {DateTime} from 'luxon';

export default function App() {

 const [dateOfBirth, setDateOfBirth] = useState('');
 const today = DateTime.local().setLocale(i18next.language);
  const minDate = today.minus({years: 7}).toJSDate();
  const maxDate = today.minus({years: 100}).toJSDate();

  render = () =>
   <DatePicker
        modal
        mode="date"
        locale={i18next.language}
        open={datePickerOpen}
        date={dateOfBirth !== '' ? DateTime.fromISO(dateOfBirth).setLocale(i18next.language).toJSDate() : minDate}
        onConfirm={onSelectDateOfBirth}
        onCancel={toggleDatePicker}
        maximumDate={minDate}
        minimumDate={maxDate}
      />

}

Smartphone (please complete the following information):

henninghall commented 3 months ago

Try the latest version of this library please