From dbbf230973e135ad4a1e667432062e2a7dd21026 Mon Sep 17 00:00:00 2001 From: Raein Date: Wed, 30 Jul 2025 18:34:55 +0900 Subject: [PATCH] fix agenda reservation list exceeded update depth for expo sdk53 --- src/agenda/reservation-list/index.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/agenda/reservation-list/index.tsx b/src/agenda/reservation-list/index.tsx index f364d9c835..7d38f98d8d 100644 --- a/src/agenda/reservation-list/index.tsx +++ b/src/agenda/reservation-list/index.tsx @@ -107,13 +107,17 @@ class ReservationList extends Component { } componentDidUpdate(prevProps: ReservationListProps) { - if (this.props.topDay && prevProps.topDay && prevProps !== this.props) { - if (!sameDate(prevProps.topDay, this.props.topDay)) { - this.setState({reservations: []}, - () => this.updateReservations(this.props) - ); - } else { - this.updateReservations(this.props); + if (this.props.topDay && prevProps.topDay) { + if ( + this.props.showOnlySelectedDayItems !== prevProps.showOnlySelectedDayItems || + this.props.items !== prevProps.items || + !sameDate(this.props.selectedDay, prevProps.selectedDay) + ) { + if (!sameDate(prevProps.topDay, this.props.topDay)) { + this.setState({reservations: []}, () => this.updateReservations(this.props)); + } else { + this.updateReservations(this.props); + } } } }