MCPcopy Create free account
hub / github.com/editablejs/editable / composeRefs

Function composeRefs

packages/ui/src/compose-refs.ts:21–23  ·  view source on GitHub ↗

* A utility to compose multiple refs together * Accepts callback refs and RefObject(s)

(...refs: PossibleRef<T>[])

Source from the content-addressed store, hash-verified

19 * Accepts callback refs and RefObject(s)
20 */
21function composeRefs<T>(...refs: PossibleRef<T>[]) {
22 return (node: T) => refs.forEach(ref => setRef(ref, node))
23}
24
25/**
26 * A custom hook that composes multiple refs

Callers 4

slot.tsxFile · 0.90
menu.tsxFile · 0.90
select.tsxFile · 0.90
useComposedRefsFunction · 0.85

Calls 1

setRefFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…