Skip to content

Commit cfc10b6

Browse files
Merge branch 'master' into tabs-new-ownerState
2 parents 613752d + ca7dd3d commit cfc10b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,14 @@ export const useGridVirtualScroller = () => {
267267
);
268268

269269
const triggerUpdateRenderContext = useEventCallback(() => {
270+
const scroller = scrollerRef.current;
271+
if (!scroller) {
272+
return undefined;
273+
}
274+
270275
const newScroll = {
271-
top: scrollerRef.current!.scrollTop,
272-
left: scrollerRef.current!.scrollLeft,
276+
top: scroller.scrollTop,
277+
left: scroller.scrollLeft,
273278
};
274279

275280
const dx = newScroll.left - scrollPosition.current.left;

0 commit comments

Comments
 (0)