Skip to content

Commit

Permalink
Issue feat :Pass empty string If value is undefined for rjsf formdata
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshataKatwal16 committed Dec 2, 2024
1 parent 7caa6e4 commit 65fd13c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
};

const cleanedFormData = cleanAndReplace(event.formData);
console.log("cleanedFormData---", cleanedFormData);

console.log("Form data changed:", cleanedFormData);

setLocalFormData(cleanedFormData);
Expand Down Expand Up @@ -247,8 +249,12 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
return error;
});
};
useEffect(() => {
// setSubmittedButtonStatus(false);
useEffect(() => {

const updatedFormData = Object.fromEntries(
Object.entries(localFormData)?.map(([key, value]) => [key, value === "undefined" ? "" : value])
);
setLocalFormData(updatedFormData);
}, []);
return (
<div>
Expand Down

0 comments on commit 65fd13c

Please sign in to comment.