react-native-calendars
react-native-calendars copied to clipboard
Update not reflect in UI
Description
In Agenda Calender,I creating different event on same date if i tried to update the each event everything is reflected on the data but not the UI.
Expected Behavior
I change to delete inside the package module reservation.js "shouldComponentUpdate(nextProps) {....." ===> When i change this part it works fine
Observed Behavior
Updating event not reflected in the UI but all are reflected in data/ logs..
I dont have any error but
I have a warning : VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc. {"contentLength": 2948, "dt": 843, "prevDt": 883}
!
Environment
Please run these commands in the project folder and fill in their results:
-
npm ls react-native-calendars
: [email protected] C:\Projects\App\NewApp\Client `-- [email protected] -
npm ls react-native
: [email protected] C:\Projects\App\NewApp\Client +-- @expo/[email protected] |-- [email protected] deduped +-- @react-native-async-storage/[email protected] |
-- [email protected] deduped +-- @react-native-community/[email protected] |-- [email protected] deduped +-- @react-native-picker/[email protected] |
-- [email protected] deduped +-- @react-navigation/[email protected] | +-- @react-navigation/[email protected] | |-- [email protected] deduped |
-- [email protected] deduped +-- @react-navigation/[email protected] |-- [email protected] deduped +-- @react-navigation/[email protected] |
-- [email protected] deduped +-- [email protected] | +-- [email protected] deduped |-- [email protected] |
-- [email protected] deduped +-- [email protected] |-- [email protected] |
-- [email protected] deduped +-- [email protected] | +-- [email protected] | |-- [email protected] deduped |
-- [email protected] |-- [email protected] deduped +-- [email protected] |
-- [email protected] deduped +-- [email protected] |-- [email protected] deduped +-- [email protected] |
-- [email protected] deduped +-- [email protected] |-- [email protected] deduped +-- [email protected] |
-- @react-native-community/[email protected] |-- [email protected] deduped
-- [email protected]-- @react-native/[email protected]
-- [email protected] deduped
Also specify:
- Device/emulator/simulator & OS version: Copy_of_Pixel_6_Pro_API_33
Reproducible Demo
Screenshots or gifs of the issue and the suggested fix will help us move faster with the review process.
I am also facing the same issue, were you able to fix this issue? @chingthampiyarilal
@srinu6, It works when i delete "shouldComponentUpdate(nextProps) {....." function, inside the node_modules\react-native-calendars\src\agenda\reservation-list\reservation.js
Yes, I can confirm, shouldComponentUpdate is not working properly.
This issue is happening for me as well. It seems to be caused by:
if (!d1 && !d2) {
changed = false;
}
in node_modules\react-native-calendars\src\agenda\reservation-list\reservation.js
shouldComponentUpdate
.
The d1
and d2
props are only provided to the first item on a given date, so any items after the first item on a date don't get updated properly.