mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
chore: code optimization (#47454)
This commit is contained in:
parent
a84af71d14
commit
be67895a93
@ -172,12 +172,12 @@ const Row = React.forwardRef<HTMLDivElement, RowProps>((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<RowContextState>(
|
||||
() => ({ gutter: [gutterH, gutterV] as [number, number], wrap }),
|
||||
[gutterH, gutterV, wrap],
|
||||
|
Loading…
Reference in New Issue
Block a user