import i from "../../../@babel/runtime/helpers/esm/slicedToArray.mjs";
import * as a from "react";
function R(c, n) {
  var e = a.useRef(c), u = a.useState({}), f = i(u, 2), o = f[1];
  function s(t) {
    var r = typeof t == "function" ? t(e.current) : t;
    r !== e.current && n(r, e.current), e.current = r, o({});
  }
  return [e.current, s];
}
export {
  R as default
};
