'use strict';

var React = require('react');

/**
 * Set a given ref to a given value
 * This utility takes care of different types of refs: callback refs and RefObject(s)
 */ function $6ed0406888f73fc4$var$setRef(ref, value) {
    if (typeof ref === 'function') ref(value);
    else if (ref !== null && ref !== undefined) ref.current = value;
}
/**
 * A utility to compose multiple refs together
 * Accepts callback refs and RefObject(s)
 */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
    return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
        )
    ;
}
/**
 * A custom hook that composes multiple refs
 * Accepts callback refs and RefObject(s)
 */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
    // eslint-disable-next-line react-hooks/exhaustive-deps
    return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
}

exports.composeRefs = $6ed0406888f73fc4$export$43e446d32b3d21af;
exports.useComposedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05;
//# sourceMappingURL=index.cjs.map
