Browse Source

Fix props equality checking functions

Arnaud Vergnet 1 year ago
parent
commit
11609f8277

+ 1
- 1
src/components/Home/EventDashboardItem.tsx View File

@@ -98,7 +98,7 @@ function EventDashBoardItem(props: PropsType) {
98 98
 }
99 99
 
100 100
 const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
101
-  return nextProps.eventNumber !== prevProps.eventNumber;
101
+  return nextProps.eventNumber === prevProps.eventNumber;
102 102
 };
103 103
 
104 104
 export default React.memo(EventDashBoardItem, areEqual);

+ 1
- 1
src/components/Home/SmallDashboardItem.tsx View File

@@ -88,7 +88,7 @@ function SmallDashboardItem(props: PropsType) {
88 88
 }
89 89
 
90 90
 const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
91
-  return nextProps.badgeCount !== prevProps.badgeCount;
91
+  return nextProps.badgeCount === prevProps.badgeCount;
92 92
 };
93 93
 
94 94
 export default React.memo(SmallDashboardItem, areEqual);

+ 1
- 1
src/components/Lists/DashboardEdit/DashboardEditItem.tsx View File

@@ -70,7 +70,7 @@ function DashboardEditItem(props: PropsType) {
70 70
 }
71 71
 
72 72
 const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
73
-  return nextProps.isActive !== prevProps.isActive;
73
+  return nextProps.isActive === prevProps.isActive;
74 74
 };
75 75
 
76 76
 export default React.memo(DashboardEditItem, areEqual);

+ 1
- 1
src/components/Lists/Equipment/EquipmentListItem.tsx View File

@@ -130,7 +130,7 @@ function EquipmentListItem(props: PropsType) {
130 130
 }
131 131
 
132 132
 const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
133
-  return nextProps.userDeviceRentDates !== prevProps.userDeviceRentDates;
133
+  return nextProps.userDeviceRentDates === prevProps.userDeviceRentDates;
134 134
 };
135 135
 
136 136
 export default React.memo(EquipmentListItem, areEqual);

Loading…
Cancel
Save