Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: mab <[email protected]>
  • Loading branch information
dtrucs and mabhub committed Nov 29, 2024
1 parent 9ce719a commit 626a9eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/hooks/useSize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MutableRefObject, RefObject, useState } from 'react';
import useResizeObserver from '@react-hook/resize-observer';
import { ResizeObserver } from '@juggle/resize-observer';
import { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer';
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';

const useSize = (target: MutableRefObject<HTMLElement | null | undefined>) => {
Expand All @@ -11,7 +11,7 @@ const useSize = (target: MutableRefObject<HTMLElement | null | undefined>) => {
}, [target]);

useResizeObserver(target as RefObject<HTMLElement>, entry => setSize(entry.contentRect ?? null), {
polyfill: ResizeObserver,
polyfill: ResizeObserverPolyfill,
});
return size;
};
Expand Down

0 comments on commit 626a9eb

Please sign in to comment.