koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
17 lines (16 loc) • 629 B
JavaScript
"use client";
import { jsx as e } from "react/jsx-runtime";
import { forwardRef as c, useReducer as a, useMemo as u } from "react";
import { FormReducer as p, initialState as f } from "./FormReducer.js";
import { FormContext as l } from "./FormContext.js";
const x = (t) => {
const { Provider: i } = l, r = c((m, s) => {
const [o, d] = a(p, f), n = u(() => ({ state: o, dispatch: d }), [o]);
return /* @__PURE__ */ e(i, { value: n, children: /* @__PURE__ */ e(t, { ...m, ref: s }) });
});
return r.displayName = "FormProvider", r;
};
export {
x as withFormProvider
};
//# sourceMappingURL=withFormProvider.js.map