UNPKG

@equinor/eds-utils

Version:

Utility functions and hooks for the Equinor Design System

12 lines (10 loc) 248 B
const mergeRefs = (...refs) => { return element => refs.forEach(ref => { if (typeof ref === 'function') { ref(element); } else if (ref && typeof ref === 'object') { ref.current = element; } }); }; export { mergeRefs };