Skip to content

Commit

Permalink
fix failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Nov 23, 2024
1 parent 4ce4e28 commit 0a0d10b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const useGridVirtualScroller = () => {
(node: HTMLDivElement | null) => {
mainRef.current = node;

if (!node || typeof ResizeObserver === 'undefined') {
if (!node) {
return undefined;
}

Expand All @@ -151,6 +151,10 @@ export const useGridVirtualScroller = () => {

apiRef.current.publishEvent('resize', lastSize);

if (typeof ResizeObserver === 'undefined') {
return undefined;
}

const observer = new ResizeObserver((entries) => {
const entry = entries[0];
if (!entry) {
Expand Down

0 comments on commit 0a0d10b

Please sign in to comment.