Skip to content

Commit

Permalink
Merge pull request #381 from AkshataKatwal16/relese-changes
Browse files Browse the repository at this point in the history
Issue feat :Pass empty string  If value is undefined for rjsf formdata
  • Loading branch information
itsvick authored Dec 2, 2024
2 parents 6cd3401 + 65fd13c commit 78e9025
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 78e9025

Please sign in to comment.