import * as i from "react";
import { useLocalizationContext as f } from "./index-useUtils.js";
function l(e, u, a) {
  const {
    value: o,
    onError: r
  } = e, c = f(), n = i.useRef(null), t = u({
    adapter: c,
    value: o,
    props: e
  });
  return i.useEffect(() => {
    r && !a(t, n.current) && r(t, o), n.current = t;
  }, [a, r, n, t, o]), t;
}
export {
  l as useValidation
};
