Skip to content

Commit fa78679

Browse files
committed
fix(ui-react-utils): fix an edge-case where safeCloneElement breaks with non-functional refs
INSTUI-4633
1 parent e39838e commit fa78679

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/ui-react-utils/src/safeCloneElement.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ Ignoring ref: ${originalRef}`
114114
} else {
115115
cloneRef.current = component
116116
}
117-
originalRef(component)
117+
118+
originalRefIsAFunction && originalRef(component)
118119
}
119120
},
120121
...children

0 commit comments

Comments
 (0)