mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
chore: improve code style and perf (#27760)
This commit is contained in:
parent
9913062d42
commit
d1d215e222
@ -44,7 +44,7 @@ function parseFlex(flex: FlexType): string {
|
||||
|
||||
return flex;
|
||||
}
|
||||
|
||||
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const;
|
||||
const Col = React.forwardRef<HTMLDivElement, ColProps>((props, ref) => {
|
||||
const { getPrefixCls, direction } = React.useContext(ConfigContext);
|
||||
const { gutter, wrap } = React.useContext(RowContext);
|
||||
@ -66,7 +66,7 @@ const Col = React.forwardRef<HTMLDivElement, ColProps>((props, ref) => {
|
||||
const prefixCls = getPrefixCls('col', customizePrefixCls);
|
||||
|
||||
let sizeClassObj = {};
|
||||
(['xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const).forEach(size => {
|
||||
sizes.forEach(size => {
|
||||
let sizeProps: ColSize = {};
|
||||
const propSize = props[size];
|
||||
if (typeof propSize === 'number') {
|
||||
|
Loading…
Reference in New Issue
Block a user