import * as l from "react";
function f(n, u) {
  if (typeof n == "function")
    return n(u);
  n != null && (n.current = u);
}
function i(...n) {
  return (u) => {
    let o = !1;
    const c = n.map((e) => {
      const t = f(e, u);
      return !o && typeof t == "function" && (o = !0), t;
    });
    if (o)
      return () => {
        for (let e = 0; e < c.length; e++) {
          const t = c[e];
          typeof t == "function" ? t() : f(n[e], null);
        }
      };
  };
}
function s(...n) {
  return l.useCallback(i(...n), n);
}
export {
  s as useComposedRefs
};
//# sourceMappingURL=use-composed-ref.es.js.map
