From a3df8b704048a6f998e79cc77c6a80a4d795a891 Mon Sep 17 00:00:00 2001 From: SakuraSM <1514383518@qq.com> Date: Wed, 11 Sep 2024 15:57:29 +0800 Subject: [PATCH] fix(grid): fix the key of cell in grid component to rerender correctly (#2068) Co-authored-by: zhengningning --- packages/zent/src/grid/Row.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/zent/src/grid/Row.tsx b/packages/zent/src/grid/Row.tsx index 46b30fc1b8..48d9525811 100644 --- a/packages/zent/src/grid/Row.tsx +++ b/packages/zent/src/grid/Row.tsx @@ -73,6 +73,7 @@ class Row extends PureComponent> { column: columnIndex, fixed, }; + const columnKey = column.name || columnIndex; cells.push( extends PureComponent> { data={data} pos={pos} columnIndex={columnIndex} - key={columnIndex} + key={columnKey} prefix={prefix} /> );