Skip to content

Commit 74e5ea2

Browse files
authored
useCombinedRefs running effect on every call. (#2852)
* Added condition to the useEffect array * removed printings * Removed prints * Removed conditional for checking if array
1 parent 4f51f4f commit 74e5ea2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/hooks/useCombinedRefs/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ const useCombinedRefs = (...refs: React.Ref<any>[]) => {
88
if (!ref) {
99
return;
1010
}
11-
1211
if (typeof ref === 'function') {
1312
ref(targetRef.current);
1413
} else {
1514
// @ts-expect-error
1615
ref.current = targetRef.current;
1716
}
1817
});
19-
}, [refs]);
18+
}, refs);
2019

2120
return targetRef;
2221
};

0 commit comments

Comments
 (0)