UNPKG

nishant-design-system

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