File tree Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export interface ListProps<T> extends React.HTMLAttributes<any> {
47
47
onScroll ?: React . UIEventHandler < HTMLElement > ;
48
48
}
49
49
50
- function RawList < T > ( props : ListProps < T > , ref : React . Ref < ListRef > ) {
50
+ export function RawList < T > ( props : ListProps < T > , ref : React . Ref < ListRef > ) {
51
51
const {
52
52
prefixCls,
53
53
className,
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import OriginList , { ListProps , ListRef } from './List' ;
2
+ import { RawList , ListProps , ListRef } from './List' ;
3
3
4
- const List = React . forwardRef ( ( props : ListProps < any > , ref : React . Ref < ListRef > ) => (
5
- < OriginList { ...props } ref = { ref } virtual = { false } />
6
- ) ) as < Item = any > (
4
+ const List = React . forwardRef ( ( props : ListProps < any > , ref : React . Ref < ListRef > ) =>
5
+ RawList ( { ...props , virtual : false } , ref ) ,
6
+ ) as < Item = any > (
7
7
props : React . PropsWithChildren < ListProps < Item > > & { ref ?: React . Ref < ListRef > } ,
8
8
) => React . ReactElement ;
9
9
Original file line number Diff line number Diff line change @@ -21,17 +21,7 @@ describe('MockList', () => {
21
21
. key ( ) ,
22
22
) . toBe ( String ( i ) ) ;
23
23
}
24
- } ) ;
25
-
26
- it ( 'do not trigger `onSkipRender`' , ( ) => {
27
- const onSkipRender = jest . fn ( ) ;
28
- const wrapper = mount (
29
- < MockList data = { [ 0 ] } itemKey = { id => id } >
30
- { id => < span > { id } </ span > }
31
- </ MockList > ,
32
- ) ;
33
24
34
- wrapper . setProps ( { data : [ 0 , 1 ] } ) ;
35
- expect ( onSkipRender ) . not . toHaveBeenCalled ( ) ;
25
+ expect ( wrapper . find ( 'List' ) ) . toHaveLength ( 1 ) ;
36
26
} ) ;
37
27
} ) ;
You can’t perform that action at this time.
0 commit comments