react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Agenda View crashing the full app

Open mfake opened this issue 6 months ago • 7 comments

Uncaught Error Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

mfake avatar Aug 21 '25 07:08 mfake

Updated my app from react-native-calendars": "^1.301.0" to "react-native-calendars": "^1.1313.0" and now I'm having the exact same issue. Tried using their example Agenda here and it also crashed my app.

saulo-m-oz avatar Aug 25 '25 14:08 saulo-m-oz

I am having the same issue

bartoszkwit avatar Sep 04 '25 09:09 bartoszkwit

I had the same issue and I found a hack that requires you to update the Agenda node_modules:

I'm using "react-native-calendars": "^1.1306.0" and RN 0.79.

In node_modules/react-native-calendars/src/agenda/reservation-list/index.js,

Replace componentDidUpdate with the following:

componentDidUpdate(prevProps) {
if (this.props.topDay && prevProps.topDay &&
(!sameDate(prevProps.topDay, this.props.topDay) ||
prevProps.items !== this.props.items ||
prevProps.selectedDay !== this.props.selectedDay
)
) {
if (!sameDate(prevProps.topDay, this.props.topDay)) {
this.setState({ reservations: [] }, () => this.updateReservations(this.props));
} else {
this.updateReservations(this.props);
}
}
}

Not sure if the maintainers of this repo will ever do anything about this issue - I've seen a few archived issues going back to 2024.

davidfeldt avatar Sep 18 '25 15:09 davidfeldt

@davidfeldt Thanks, this does fix the issue.

SyedZawwarAhmed avatar Sep 22 '25 13:09 SyedZawwarAhmed

I had the same issue and I found a hack that requires you to update the Agenda node_modules:

I'm using "react-native-calendars": "^1.1306.0" and RN 0.79.

In node_modules/react-native-calendars/src/agenda/reservation-list/index.js,

Replace componentDidUpdate with the following:

componentDidUpdate(prevProps) {
if (this.props.topDay && prevProps.topDay &&
(!sameDate(prevProps.topDay, this.props.topDay) ||
prevProps.items !== this.props.items ||
prevProps.selectedDay !== this.props.selectedDay
)
) {
if (!sameDate(prevProps.topDay, this.props.topDay)) {
this.setState({ reservations: [] }, () => this.updateReservations(this.props));
} else {
this.updateReservations(this.props);
}
}
}

Not sure if the maintainers of this repo will ever do anything about this issue - I've seen a few archived issues going back to 2024.

thats fine and dandy, but i do not want to create a js post install script just to modify that part of code, just to make it work with expo app service.. they really need to merge this one https://github.com/wix/react-native-calendars/pull/2713

Ren-Logronio avatar Oct 15 '25 02:10 Ren-Logronio

+1

caioedut avatar Nov 11 '25 19:11 caioedut

+1 where are we on the fix ?

singhagam1 avatar Nov 19 '25 18:11 singhagam1