Add undefined check on scrollTo
This commit is contained in:
parent
915b0eb372
commit
6deab38c67
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ export const VirtualInfiniteGrid = forwardRef(
|
|||
}
|
||||
},
|
||||
scrollTo: (index: number) => {
|
||||
listRef.current.scrollToItem(index);
|
||||
listRef?.current?.scrollToItem(index);
|
||||
},
|
||||
setItemData: (data: any[]) => {
|
||||
setItemData(data);
|
||||
|
|
Reference in a new issue