File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ const Options: React.FC<OptionsProps> = (props) => {
4848
4949  const  [ goInputText ,  setGoInputText ]  =  React . useState ( '' ) ; 
5050
51-   const  getValidValue  =  ( )  =>  { 
51+   const  getValidValue  =  React . useMemo < number > ( ( )  =>  { 
5252    return  ! goInputText  ||  Number . isNaN ( goInputText ) 
5353      ? undefined 
5454      : Number ( goInputText ) ; 
55-   } ; 
55+   } ,   [ goInputText ] ) ; 
5656
5757  const  mergeBuildOptionText  = 
5858    typeof  buildOptionText  ===  'function' 
@@ -70,12 +70,12 @@ const Options: React.FC<OptionsProps> = (props) => {
7070    setGoInputText ( '' ) ; 
7171    if  ( 
7272      e . relatedTarget  && 
73-       ( e . relatedTarget . className . indexOf ( `${ rootPrefixCls }  -item-link` )   >=   0  || 
74-         e . relatedTarget . className . indexOf ( `${ rootPrefixCls }  -item` )   >=   0 ) 
73+       ( e . relatedTarget . className . includes ( `${ rootPrefixCls }  -item-link` )  || 
74+         e . relatedTarget . className . includes ( `${ rootPrefixCls }  -item` ) ) 
7575    )  { 
7676      return ; 
7777    } 
78-     quickGo ?.( getValidValue ( ) ) ; 
78+     quickGo ?.( getValidValue ) ; 
7979  } ; 
8080
8181  const  go  =  ( e : any )  =>  { 
@@ -84,7 +84,7 @@ const Options: React.FC<OptionsProps> = (props) => {
8484    } 
8585    if  ( e . keyCode  ===  KEYCODE . ENTER  ||  e . type  ===  'click' )  { 
8686      setGoInputText ( '' ) ; 
87-       quickGo ?.( getValidValue ( ) ) ; 
87+       quickGo ?.( getValidValue ) ; 
8888    } 
8989  } ; 
9090
Original file line number Diff line number Diff line change @@ -10,11 +10,8 @@ import Options from './Options';
1010import  type  {  PagerProps  }  from  './Pager' ; 
1111import  Pager  from  './Pager' ; 
1212
13- const  defaultItemRender : PaginationProps [ 'itemRender' ]  =  ( 
14-   page , 
15-   type , 
16-   element , 
17- )  =>  element ; 
13+ const  defaultItemRender : PaginationProps [ 'itemRender' ]  =  ( _ ,  __ ,  element )  => 
14+   element ; 
1815
1916function  noop ( )  { } 
2017
@@ -244,8 +241,8 @@ const Pagination: React.FC<PaginationProps> = (props) => {
244241
245242  function  runIfEnter ( 
246243    event : React . KeyboardEvent < HTMLLIElement > , 
247-     callback , 
248-     ...restParams 
244+     callback :  ( ... args :  any [ ] )   =>   void , 
245+     ...restParams :  any [ ] 
249246  )  { 
250247    if  ( 
251248      event . key  ===  'Enter'  || 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments