UNPKG

@modern-kit/react

Version:
16 lines (13 loc) 331 B
import { isFunction } from '@modern-kit/utils'; const mergeRefs = (...refs) => { return (node) => refs.forEach((ref) => { if (isFunction(ref)) { ref(node); } else if (ref != null) { const refToUse = ref; refToUse.current = node; } }); }; export { mergeRefs }; //# sourceMappingURL=index.mjs.map