@@ -56,11 +56,11 @@ const ListComponent = forwardRef(function (
56
56
) {
57
57
// hooks
58
58
const timeoutRef = useRef ( 0 ) ;
59
- const cacheRef = useRef < any > ( { } ) ;
60
59
const listRef = useRef < any > ( null ) ;
61
60
const prevWidthRef = useRef ( width ) ;
62
61
const treeRef = useRef ( new NumberTree ( ) ) ;
63
62
const tableRef = useRef < HTMLDivElement > ( null ) ;
63
+ const cacheRef = useRef < { [ index : number ] : number } > ( { } ) ;
64
64
const { dispatch, uuid, columns, minColumnWidth, fixedWidth, remainingCols, pixelWidths } =
65
65
useContext ( TableContext ) ;
66
66
const [ useRowWidth , setUseRowWidth ] = useState ( true ) ;
@@ -73,7 +73,7 @@ const ListComponent = forwardRef(function (
73
73
74
74
// functions
75
75
const generateKeyFromRow = useCallback (
76
- ( row : any , defaultValue : number ) => {
76
+ function < T > ( row : T , defaultValue : number ) {
77
77
const generatedKey = itemKey ? itemKey ( row ) : undefined ;
78
78
return generatedKey !== undefined ? generatedKey : defaultValue ;
79
79
} ,
@@ -174,7 +174,7 @@ const ListComponent = forwardRef(function (
174
174
const dataIndex = parseInt ( node . dataset . index || "0" ) ;
175
175
176
176
// if the row is incorrect, update the tops going forward
177
- const height = cache [ dataIndex + 1 ] . size ;
177
+ const height : number = cache [ dataIndex + 1 ] . size ;
178
178
const computed = calculateHeight ( node , dataIndex ) ;
179
179
180
180
// case 0: the first element, where the top is correct
0 commit comments