From be67895a9358f681871da41c3935d705f86ec0bc Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Sat, 17 Feb 2024 19:56:41 +0800 Subject: [PATCH] chore: code optimization (#47454) --- components/grid/row.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/grid/row.tsx b/components/grid/row.tsx index 4b097ca34a..c46f0601b0 100644 --- a/components/grid/row.tsx +++ b/components/grid/row.tsx @@ -172,12 +172,12 @@ const Row = React.forwardRef((props, ref) => { rowStyle.marginRight = horizontalGutter; } - [, rowStyle.rowGap] = gutters; - // "gutters" is a new array in each rendering phase, it'll make 'React.useMemo' effectless. // So we deconstruct "gutters" variable here. const [gutterH, gutterV] = gutters; + rowStyle.rowGap = gutterV; + const rowContext = React.useMemo( () => ({ gutter: [gutterH, gutterV] as [number, number], wrap }), [gutterH, gutterV, wrap],