Skip to content

Commit 052416d

Browse files
committed
useCallback
1 parent 77eacf5 commit 052416d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/calendar/header/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ const CalendarHeader = forwardRef((props: CalendarHeaderProps, ref) => {
123123
return subtractMonth();
124124
}, [onPressArrowLeft]);
125125

126-
const onPressRight = () => {
126+
const onPressRight = useCallback(() => {
127127
if (typeof onPressArrowRight === 'function') {
128128
return onPressArrowRight(addMonth, month);
129129
}
130130
return addMonth();
131-
};
131+
}, [onPressArrowRight]);
132132

133133
const onAccessibilityAction = (event: AccessibilityActionEvent) => {
134134
switch (event.nativeEvent.actionName) {

0 commit comments

Comments
 (0)