fix agenda reservation list exceeded update depth for expo sdk53 #2713
+11
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request will fix the issue mentioned here: #2705
Fix: Avoid infinite update loop in Agenda > ReservationList on Expo SDK 53+
Problem
When using react-native-calendars in Expo SDK 53+, the app crashes due to a Maximum update depth exceeded error in the ReservationList component of the Agenda.
This was caused by an infinite re-render triggered in componentDidUpdate, due to the state being set on every prop change without proper guarding.
Solution
Updated the componentDidUpdate method to check for meaningful changes in props (showOnlySelectedDayItems, items, and selectedDay) before calling setState or updating reservations.
This patch was submitted using @dangthequan 's contribution.