BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
936 stars 325 forks source link

selectedDate prop change not updating state #249

Closed ganesh-papola closed 3 years ago

ganesh-papola commented 3 years ago

Is. there any prop for value, as selectedDate is not working when changing its value?

Vasault commented 3 years ago

startingDay, but really, what exactly you looking for?

peacechen commented 3 years ago

After looking through the code, there is a bug with selectedDate prop updates. It's not updating state on a change.

https://github.com/BugiDev/react-native-calendar-strip/blob/master/src/CalendarStrip.js#L146

Please submit a PR to add selectedDate to componentDidUpdate(). It should perform the same checks as it does for startingDate because the prop may come in as a string, JS Date, or Moment date.

peacechen commented 3 years ago

Fix published in 2.1.2