File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default class VirtualList extends PureComponent {
38
38
sizeAndPositionManager = new SizeAndPositionManager ( {
39
39
itemCount : this . props . itemCount ,
40
40
itemSizeGetter : ( { index} ) => this . getSize ( index ) ,
41
- estimatedItemSize : this . props . estimatedItemSize || typeof this . props . itemSize === "number" && this . props . itemSize || 50 ,
41
+ estimatedItemSize : this . getEstimatedItemSize ( ) ,
42
42
} ) ;
43
43
44
44
state = {
@@ -90,7 +90,7 @@ export default class VirtualList extends PureComponent {
90
90
) {
91
91
this . sizeAndPositionManager . updateConfig ( {
92
92
itemCount : nextProps . itemCount ,
93
- estimatedItemSize : nextProps . itemSize ,
93
+ estimatedItemSize : this . getEstimatedItemSize ( nextProps ) ,
94
94
} ) ;
95
95
}
96
96
@@ -131,6 +131,10 @@ export default class VirtualList extends PureComponent {
131
131
}
132
132
} ;
133
133
134
+ getEstimatedItemSize ( props = this . props ) {
135
+ return props . estimatedItemSize || typeof props . itemSize === "number" && props . itemSize || 50 ;
136
+ }
137
+
134
138
getNodeOffset ( ) {
135
139
const { scrollDirection} = this . props ;
136
140
return this . rootNode [ scrollProp [ scrollDirection ] ] ;
You can’t perform that action at this time.
0 commit comments