Skip to content

useMergedRefs

@astryxdesign/core v0.7.1 · useMergedRefs

Parameters ​

NameTypeDefaultDescription
refsreadonly MergedRef<T>[]—Up to six refs that should all receive the same element. One entry is a Ref<T | null>, a function ref, null, or undefined; empty slots are skipped. Required.

Returns ​

NameTypeDescription
mergedRef(value: Element | ComponentPublicInstance | null) => voidA merged callback ref that remains stable for the life of the component. It accepts whatever Vue hands a template ref, including null on unmount, and forwards the value to every entry in refs.