File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
19
19
import StickyContainer , { StickyContainerProps } from "recyclerlistview/sticky" ;
20
20
21
21
import AutoLayoutView , { BlankAreaEventHandler } from "./AutoLayoutView" ;
22
- import ItemContainer from "./CellContainer" ;
22
+ import CellContainer from "./CellContainer" ;
23
23
import { PureComponentWrapper } from "./PureComponentWrapper" ;
24
24
import GridLayoutProviderWithProps from "./GridLayoutProviderWithProps" ;
25
25
import CustomError from "./errors/CustomError" ;
@@ -132,6 +132,8 @@ export interface FlashListProps<T> extends FlatListProps<T> {
132
132
| ( ( info : { viewableItems : ViewToken [ ] ; changed : ViewToken [ ] } ) => void )
133
133
| null
134
134
| undefined ;
135
+
136
+ CellRendererComponent ?: typeof CellContainer | undefined ;
135
137
}
136
138
137
139
export interface FlashListState < T > {
@@ -535,8 +537,10 @@ class FlashList<T> extends React.PureComponent<
535
537
} ;
536
538
537
539
private itemContainer = ( props : any , parentProps : any ) => {
540
+ const CellRendererComponent =
541
+ this . props . CellRendererComponent ?? CellContainer ;
538
542
return (
539
- < ItemContainer
543
+ < CellRendererComponent
540
544
{ ...props }
541
545
style = { {
542
546
...props . style ,
@@ -553,7 +557,7 @@ class FlashList<T> extends React.PureComponent<
553
557
arg = { parentProps . index }
554
558
renderer = { this . getCellContainerChild }
555
559
/>
556
- </ ItemContainer >
560
+ </ CellRendererComponent >
557
561
) ;
558
562
} ;
559
563
Original file line number Diff line number Diff line change @@ -23,3 +23,4 @@ export {
23
23
export { JSFPSMonitor , JSFPSResult } from "./benchmark/JSFPSMonitor" ;
24
24
export { autoScroll , Cancellable } from "./benchmark/AutoScrollHelper" ;
25
25
export { default as ViewToken } from "./ViewToken" ;
26
+ export { default as CellContainer } from "./CellContainer" ;
You can’t perform that action at this time.
0 commit comments