Skip to content

Commit 624b133

Browse files
jquensekyletsang
andauthored
Update src/useMergedRefs.ts
Co-authored-by: Kyle Tsang <[email protected]>
1 parent d4b9ebf commit 624b133

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/useMergedRefs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export function mergeRefs<T>(refA?: Ref<T> | null, refB?: Ref<T> | null) {
2727
const refASetter = toFnRef(refA)
2828
const refBSetter = toFnRef(refB)
2929

30-
if (isReact19) {
31-
return (value: T | null) => {
32-
const cleanupA = refASetter?.(value)
33-
const cleanupB = refBSetter?.(value)
30+
return (value: T | null) => {
31+
const cleanupA = refASetter?.(value)
32+
const cleanupB = refBSetter?.(value)
3433

34+
if (isReact19) {
3535
return () => {
3636
cleanUp(cleanupA, refASetter)
3737
cleanUp(cleanupB, refBSetter)

0 commit comments

Comments
 (0)