HosseinShabani / react-native-modern-datepicker

A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale)
MIT License
573 stars 159 forks source link

Changing current prop does not reload the calendar #150

Open Hiszpan opened 3 months ago

Hiszpan commented 3 months ago

Describe the bug After update const holding current value calendar still displays old date.

To Reproduce Steps to reproduce the behavior: implement code:

const [current, setCurrent] = useState('1990-01-03');
useEffect(() => {
  setTimeout(() => {
    setCurrent('2000-12-09');
  }, 2000);
}, []);

<ModernDatePicker
  mode='calendar'
  current={current}
/>

Expected behavior Calendar should change year and month to 2000-12-09.