@overmap-ai/core 1.0.28-integrate-forms.3 → 1.0.28-integrate-forms.4
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.
|
@@ -9644,6 +9644,21 @@ var __publicField = (obj, key, value) => {
|
|
|
9644
9644
|
});
|
|
9645
9645
|
const PatchField = React.memo((props) => {
|
|
9646
9646
|
console.log("PatchField props:", props);
|
|
9647
|
+
const { name, render } = props;
|
|
9648
|
+
const { submitForm } = formik.useFormikContext();
|
|
9649
|
+
const [fieldProps, _meta, helpers] = formik.useField(name);
|
|
9650
|
+
React.useMemo(() => {
|
|
9651
|
+
const setValue = (value) => {
|
|
9652
|
+
void helpers.setValue(value, false);
|
|
9653
|
+
};
|
|
9654
|
+
return render({
|
|
9655
|
+
value: fieldProps.value,
|
|
9656
|
+
setValue,
|
|
9657
|
+
patchValue: () => {
|
|
9658
|
+
void submitForm();
|
|
9659
|
+
}
|
|
9660
|
+
});
|
|
9661
|
+
}, [submitForm, helpers, fieldProps.value, render]);
|
|
9647
9662
|
return null;
|
|
9648
9663
|
});
|
|
9649
9664
|
PatchField.displayName = "PatchField";
|