Skip to content

Commit

Permalink
fixed AutoForm not updating upon changes to findBy objects
Browse files Browse the repository at this point in the history
  • Loading branch information
MillanWangGadget committed Sep 17, 2024
1 parent 8fe1cf5 commit 9cad7f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/auto/mui/MUIAutoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const MUIAutoForm = <
}

// Component key to force re-render when the action or findBy changes
const componentKey = `${action.modelApiIdentifier ?? ""}.${action.operationName}.${findBy}`;
const componentKey = `${action.modelApiIdentifier ?? ""}.${action.operationName}.${JSON.stringify(findBy)}`;

return <MUIAutoFormComponent key={componentKey} {...props} />;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/auto/polaris/PolarisAutoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PolarisAutoForm = <
}

// Component key to force re-render when the action or findBy changes
const componentKey = `${action.modelApiIdentifier ?? ""}.${action.operationName}.${findBy}`;
const componentKey = `${action.modelApiIdentifier ?? ""}.${action.operationName}.${JSON.stringify(findBy)}`;

return (
<PolarisAutoFormComponent
Expand Down

0 comments on commit 9cad7f3

Please sign in to comment.