chore: improve code style and perf (#27760)

This commit is contained in:
Eugene Matvejev 2020-11-13 11:37:23 +00:00 committed by GitHub
parent 9913062d42
commit d1d215e222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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') {