We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae695e3 commit 69c380aCopy full SHA for 69c380a
src/hooks/useResizeObserver/index.ts
@@ -9,11 +9,11 @@ type ResizeCallback = (entry: ResizeObserverEntry) => void;
9
* @param callback - 尺寸变化时的回调函数
10
* @param options - ResizeObserver 的配置选项
11
*/
12
-function useResizeObserver<T extends HTMLElement>(
+const useResizeObserver = <T extends HTMLElement>(
13
ref: React.RefObject<T>,
14
callback: ResizeCallback,
15
options?: ResizeObserverOptions
16
-): void {
+): void => {
17
const observerRef = useRef<ResizeObserver>();
18
19
useEffect(() => {
0 commit comments