From 4032c0ffaceb0a2bb4379f53fe9803b0ac05ec72 Mon Sep 17 00:00:00 2001 From: Randy Schott <1815175+schottra@users.noreply.github.com> Date: Mon, 6 Jul 2020 14:13:12 -0700 Subject: [PATCH] refactor: Use a functional updater for expanded errors state Co-authored-by: Bob Nisco <1316246+BobNisco@users.noreply.github.com> --- src/components/Executions/Tables/WorkflowExecutionsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Executions/Tables/WorkflowExecutionsTable.tsx b/src/components/Executions/Tables/WorkflowExecutionsTable.tsx index 786486bb4..ab45b37d8 100644 --- a/src/components/Executions/Tables/WorkflowExecutionsTable.tsx +++ b/src/components/Executions/Tables/WorkflowExecutionsTable.tsx @@ -263,7 +263,7 @@ export const WorkflowExecutionsTable: React.FC = p const execution = executions[rowProps.index]; const cacheKey = getCacheKey(execution.id); const onExpandCollapseError = (expanded: boolean) => { - setExpandedErrors({ ...expandedErrors, [cacheKey]: expanded }); + setExpandedErrors(currentExpandedErrors => ({ ...currentExpandedErrors, [cacheKey]: expanded })); recomputeRow(rowProps.index); }; return (