import { useRef as v, useState as m, useCallback as p } from "react";
function R(t, o, s) {
  const e = v(t !== void 0), [n, c] = m(o), r = t !== void 0, i = e.current;
  return e.current = r, !r && i && n !== o && c(o), [
    r ? t : n,
    p(
      (...P) => {
        const [u, ...a] = P, f = s?.(u, ...a);
        return c(u), f;
      },
      [s]
    )
  ];
}
export {
  R as useUncontrolledProp
};
//# sourceMappingURL=useUncontrollable.js.map
