From 9cad7f3efca4eb98abd4ce6f4460f31957db97dc Mon Sep 17 00:00:00 2001 From: MillanWangGadget Date: Tue, 17 Sep 2024 10:06:03 -0400 Subject: [PATCH] fixed AutoForm not updating upon changes to findBy objects --- packages/react/src/auto/mui/MUIAutoForm.tsx | 2 +- packages/react/src/auto/polaris/PolarisAutoForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/auto/mui/MUIAutoForm.tsx b/packages/react/src/auto/mui/MUIAutoForm.tsx index b32269688..eeb4e60ae 100644 --- a/packages/react/src/auto/mui/MUIAutoForm.tsx +++ b/packages/react/src/auto/mui/MUIAutoForm.tsx @@ -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 ; }; diff --git a/packages/react/src/auto/polaris/PolarisAutoForm.tsx b/packages/react/src/auto/polaris/PolarisAutoForm.tsx index 80221b3d8..95caccdd6 100644 --- a/packages/react/src/auto/polaris/PolarisAutoForm.tsx +++ b/packages/react/src/auto/polaris/PolarisAutoForm.tsx @@ -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 (