Skip to content

Commit 5255317

Browse files
authored
fix(fuselage-hooks): useResizeObserver Ref type (#531)
1 parent 9cf7dbd commit 5255317

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/fuselage-hooks/src/useResizeObserver.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ type UseResizeObserverOptions = {
1616
* @returns a triple containing the ref and the size information
1717
* @public
1818
*/
19-
export const useResizeObserver = ({
19+
export const useResizeObserver = <T extends Element>({
2020
debounceDelay,
2121
}: UseResizeObserverOptions = {}): {
22-
ref: RefObject<Element>;
22+
ref: RefObject<T>;
2323
contentBoxSize: ResizeObserverSize;
2424
borderBoxSize: ResizeObserverSize;
2525
} => {
26-
const ref = useRef<Element>();
26+
const ref = useRef<T>();
2727
const [{ borderBoxSize, contentBoxSize }, setSizes] = useDebouncedState<{
2828
borderBoxSize: ResizeObserverSize;
2929
contentBoxSize: ResizeObserverSize;

0 commit comments

Comments
 (0)