react-f0rm 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1443,7 +1443,13 @@
1443
1443
  function useFieldArray(options) {
1444
1444
  return useFieldArrayCore(options, Context);
1445
1445
  }
1446
- return { FormProvider: FormProvider2, useFormContext: useFormContext2, useField, useFieldArray };
1446
+ return {
1447
+ context: Context,
1448
+ FormProvider: FormProvider2,
1449
+ useFormContext: useFormContext2,
1450
+ useField,
1451
+ useFieldArray
1452
+ };
1447
1453
  }
1448
1454
  const CheckboxGroupContext = React.createContext(null);
1449
1455
  const CheckboxGroupProvider = CheckboxGroupContext.Provider;
@@ -1455,6 +1461,7 @@
1455
1461
 
1456
1462
  function Form({
1457
1463
  form: f1,
1464
+ context,
1458
1465
  initialValues,
1459
1466
  values,
1460
1467
  onSubmit,
@@ -1471,7 +1478,8 @@
1471
1478
  onInvalidSubmit,
1472
1479
  shouldFocusError
1473
1480
  });
1474
- return /* @__PURE__ */ React__namespace.createElement(FormProvider, { value: form }, /* @__PURE__ */ React__namespace.createElement("form", { ...props, noValidate: true, onSubmit: submit }));
1481
+ const { Provider } = context ?? FormContext;
1482
+ return /* @__PURE__ */ React__namespace.createElement(Provider, { value: form }, /* @__PURE__ */ React__namespace.createElement("form", { ...props, noValidate: true, onSubmit: submit }));
1475
1483
  }
1476
1484
 
1477
1485
  function setRef(ref, value) {