import { useCallback } from 'react';

function useMergeRefs(...refs) {
  return useCallback(node => {
    refs.forEach(ref => {
      if (!ref) return;
      if (typeof ref === 'function') {
        ref(node);
      } else if (ref && 'current' in ref) {
        ref.current = node;
      }
    });
  }, [refs]);
}

export { useMergeRefs };
//# sourceMappingURL=useMergeRefs.js.map
