import { o as n } from "./rolldown-runtime.js";
import { i as u } from "./vendor/react.js";
var o = /* @__PURE__ */ n(u(), 1);
function f({ value: r, defaultValue: i, onChange: e }) {
  const [s, l] = o.useState(i), t = r !== void 0;
  return [t ? r : s, o.useCallback((a) => {
    t || l(a), e?.(a);
  }, [t, e])];
}
export {
  f as t
};

//# sourceMappingURL=use-controllable-state.js.map