maggialejandro/react-native-calendario

Calendar doesn't rerender on markedDates change

vasilev-alex opened this issue · 3 comments

Current behaviour

markedDates property is ignored after calendar has rendered

Expected behaviour

If I change state of markedDates and pass it to calendar it updates marked dates

Code sample

For Syntax Highlighting check this link

Screenshots (if applicable)

What have you tried

Your Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

@maggialejandro
It seems the problem inside Month component. Should be something like this?
(prevProps: Props, nextProps: Props) => { if (JSON.stringify(prevProps.markedDays) !== JSON.stringify(nextProps.markedDays)) { return false } ...}

@maggialejandro It seems the problem inside Month component. Should be something like this? (prevProps: Props, nextProps: Props) => { if (JSON.stringify(prevProps.markedDays) !== JSON.stringify(nextProps.markedDays)) { return false } ...}

That's right, it should be changed here

https://github.com/maggialejandro/react-native-month/blob/aac87c30e44cb85bcb6addc0286f7e04fa74d337/src/utils/validations.ts#L28-L33