@@ -7,7 +7,7 @@ import Filler from './Filler';
7
7
import type { InnerProps } from './Filler' ;
8
8
import type { ScrollBarDirectionType , ScrollBarRef } from './ScrollBar' ;
9
9
import ScrollBar from './ScrollBar' ;
10
- import type { RenderFunc , SharedConfig , GetKey } from './interface' ;
10
+ import type { RenderFunc , SharedConfig , GetKey , ExtraRenderInfo } from './interface' ;
11
11
import useChildren from './hooks/useChildren' ;
12
12
import useHeights from './hooks/useHeights' ;
13
13
import useScrollTo from './hooks/useScrollTo' ;
@@ -69,6 +69,9 @@ export interface ListProps<T> extends Omit<React.HTMLAttributes<any>, 'children'
69
69
70
70
/** Inject to inner container props. Only use when you need pass aria related data */
71
71
innerProps ?: InnerProps ;
72
+
73
+ /** Render extra content into Filler */
74
+ extraRender ?: ( info : ExtraRenderInfo ) => React . ReactNode ;
72
75
}
73
76
74
77
export function RawList < T > ( props : ListProps < T > , ref : React . Ref < ListRef > ) {
@@ -89,6 +92,7 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
89
92
onScroll,
90
93
onVisibleChange,
91
94
innerProps,
95
+ extraRender,
92
96
...restProps
93
97
} = props ;
94
98
@@ -386,7 +390,23 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
386
390
} , [ start , end , mergedData ] ) ;
387
391
388
392
// ================================ Render ================================
389
- const listChildren = useChildren ( mergedData , start , end , setInstanceRef , children , sharedConfig ) ;
393
+ const listChildren = useChildren (
394
+ mergedData ,
395
+ start ,
396
+ end ,
397
+ scrollWidth ,
398
+ setInstanceRef ,
399
+ children ,
400
+ sharedConfig ,
401
+ ) ;
402
+
403
+ const extraContent = extraRender ?.( {
404
+ start,
405
+ end,
406
+ virtual : inVirtual ,
407
+ offsetX : offsetLeft ,
408
+ rtl : isRTL ,
409
+ } ) ;
390
410
391
411
let componentStyle : React . CSSProperties = null ;
392
412
if ( height ) {
@@ -438,13 +458,14 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
438
458
ref = { fillerInnerRef }
439
459
innerProps = { innerProps }
440
460
rtl = { isRTL }
461
+ extra = { extraContent }
441
462
>
442
463
{ listChildren }
443
464
</ Filler >
444
465
</ Component >
445
466
</ ResizeObserver >
446
467
447
- { useVirtual && scrollHeight > height && (
468
+ { inVirtual && scrollHeight > height && (
448
469
< ScrollBar
449
470
ref = { verticalScrollBarRef }
450
471
prefixCls = { prefixCls }
@@ -459,7 +480,7 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
459
480
/>
460
481
) }
461
482
462
- { useVirtual && scrollWidth && (
483
+ { inVirtual && scrollWidth && (
463
484
< ScrollBar
464
485
ref = { horizontalScrollBarRef }
465
486
prefixCls = { prefixCls }
0 commit comments