"use strict"; exports.__esModule = true; exports.default = void 0; exports.mergeRefs = mergeRefs; var _react = require("react"); const toFnRef = ref => !ref || typeof ref === 'function' ? ref : value => { ref.current = value; }; function mergeRefs(refA, refB) { const a = toFnRef(refA); const b = toFnRef(refB); return value => { if (a) a(value); if (b) b(value); }; } /** * Create and returns a single callback ref composed from two other Refs. * * ```tsx * const Button = React.forwardRef((props, ref) => { * const [element, attachRef] = useCallbackRef(); * const mergedRef = useMergedRefs(ref, attachRef); * * return