UNPKG

@spaced-out/ui-design-system

Version:
15 lines (14 loc) 311 B
// @flow strict export function mergeRefs( refs: Array<{current: ?HTMLElement}>, ): (value: ?HTMLElement) => void { return (value) => { refs.forEach((ref) => { if (typeof ref === 'function') { ref(value); } else if (ref != null) { ref.current = value; } }); }; }