File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -108,27 +108,27 @@ const CalendarHeader = forwardRef((props: CalendarHeaderProps, ref) => {
108108 onPressRight
109109 } ) ) ;
110110
111- const addMonth = ( ) => {
111+ const addMonth = useCallback ( ( ) => {
112112 propsAddMonth ?.( 1 ) ;
113- } ;
113+ } , [ propsAddMonth ] ) ;
114114
115- const subtractMonth = ( ) => {
115+ const subtractMonth = useCallback ( ( ) => {
116116 propsAddMonth ?.( - 1 ) ;
117- } ;
117+ } , [ propsAddMonth ] ) ;
118118
119119 const onPressLeft = useCallback ( ( ) => {
120120 if ( typeof onPressArrowLeft === 'function' ) {
121121 return onPressArrowLeft ( subtractMonth , month ) ;
122122 }
123123 return subtractMonth ( ) ;
124- } , [ onPressArrowLeft ] ) ;
124+ } , [ onPressArrowLeft , subtractMonth ] ) ;
125125
126126 const onPressRight = useCallback ( ( ) => {
127127 if ( typeof onPressArrowRight === 'function' ) {
128128 return onPressArrowRight ( addMonth , month ) ;
129129 }
130130 return addMonth ( ) ;
131- } , [ onPressArrowRight ] ) ;
131+ } , [ onPressArrowRight , addMonth ] ) ;
132132
133133 const onAccessibilityAction = ( event : AccessibilityActionEvent ) => {
134134 switch ( event . nativeEvent . actionName ) {
You can’t perform that action at this time.
0 commit comments