web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
662 stars 170 forks source link

undefined is not function when using multiple, after select multi dates and show DatePickerModal again #275

Closed tiendat0811 closed 1 year ago

tiendat0811 commented 1 year ago

Current behaviour

undefined is not function when using multiple, after select multi dates and show DatePickerModal again

  const [showDate, setShowDate] = useState(false);
  const [dates, setDates] = useState<any>([]);

  <DatePickerModal
    locale="en"
    mode="multiple"
    visible={showDate}
    onDismiss={() => setShowDate(false)}
    dates={dates}
    onConfirm={dates => {
      console.log(dates);
      setShowDate(false);
      setDates(dates);
    }}
  />

Screenshot_1680153347

github-actions[bot] commented 1 year ago

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.