先 any 了
This commit is contained in:
parent
5cad14c60b
commit
d31a4e1441
|
@ -141,7 +141,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
};
|
||||
|
||||
itemSizeGetter = (itemSize: Props['itemSize']) => {
|
||||
return index => this.getSize(index, itemSize);
|
||||
return (index: any) => this.getSize(index, itemSize);
|
||||
};
|
||||
|
||||
sizeAndPositionManager = new SizeAndPositionManager({
|
||||
|
@ -275,7 +275,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
scrollTo(value: number) {
|
||||
const {scrollDirection = DIRECTION.VERTICAL} = this.props;
|
||||
|
||||
this.rootNode[scrollProp[scrollDirection]] = value;
|
||||
(this.rootNode as any)[scrollProp[scrollDirection]] = value;
|
||||
}
|
||||
|
||||
getOffsetForIndex(
|
||||
|
@ -291,7 +291,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
|
||||
return this.sizeAndPositionManager.getUpdatedOffsetForIndex({
|
||||
align: scrollToAlignment,
|
||||
containerSize: this.props[sizeProp[scrollDirection]],
|
||||
containerSize: this.props[sizeProp[scrollDirection] as 'scrollOffset']!,
|
||||
currentOffset: (this.state && this.state.offset) || 0,
|
||||
targetIndex: index
|
||||
});
|
||||
|
@ -323,7 +323,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
} = this.props;
|
||||
const {offset} = this.state;
|
||||
const {start, stop} = this.sizeAndPositionManager.getVisibleRange({
|
||||
containerSize: this.props[sizeProp[scrollDirection]] || 0,
|
||||
containerSize: (this as any).props[sizeProp[scrollDirection]] || 0,
|
||||
offset,
|
||||
overscanCount
|
||||
});
|
||||
|
@ -407,7 +407,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
private getNodeOffset() {
|
||||
const {scrollDirection = DIRECTION.VERTICAL} = this.props;
|
||||
|
||||
return this.rootNode[scrollProp[scrollDirection]];
|
||||
return (this as any).rootNode[scrollProp[scrollDirection]];
|
||||
}
|
||||
|
||||
private getEstimatedItemSize(props = this.props) {
|
||||
|
@ -418,7 +418,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
|
|||
);
|
||||
}
|
||||
|
||||
private getSize(index: number, itemSize) {
|
||||
private getSize(index: number, itemSize: any) {
|
||||
if (typeof itemSize === 'function') {
|
||||
return itemSize(index);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue