diff --git a/src/hooks/useResizeObserver/useResizeObserver.ts b/src/hooks/useResizeObserver/useResizeObserver.ts index f20b672..4fb76a4 100644 --- a/src/hooks/useResizeObserver/useResizeObserver.ts +++ b/src/hooks/useResizeObserver/useResizeObserver.ts @@ -11,6 +11,7 @@ import { unref, type Unreffable } from '../../utils/unref/unref.js'; export function useResizeObserver( target: Unreffable, callback?: ResizeObserverCallback | undefined, + options?: ResizeObserverOptions, ): void { useEffect(() => { const element = unref(target); @@ -20,10 +21,10 @@ export function useResizeObserver( } const resizeObserver = new ResizeObserver(callback); - resizeObserver.observe(element); + resizeObserver.observe(element, options); return () => { resizeObserver.disconnect(); }; - }, [target, callback]); + }, [target, callback, options]); }