Agenda View crashing the full app
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.
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.
I am having the same issue
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 Thanks, this does fix the issue.
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
+1
+1 where are we on the fix ?