При использовании styled-system
с styled-components
, как, если таковые имеются, влияют на производительность загрузки в большее количество реквизита, чем я могу использовать?
Например, это то, что у меня сейчас есть для базового Div
компонента, но есть тонны других реквизитов, которые я не использую - например, fontSize
и fontSizeProps
в качестве два десятка других примеров.
import React from 'react';
import { themed } from 'Utils/theme.helpers';
import styled from 'styled-components';
import {
alignSelf,
AlignSelfProps,
height,
HeightProps,
maxHeight,
MaxHeightProps,
maxWidth,
MaxWidthProps,
minHeight,
MinHeightProps,
minWidth,
MinWidthProps,
order,
OrderProps,
overflow,
OverflowProps,
space,
SpaceProps,
width,
WidthProps,
} from 'styled-system';
export type DivProps = React.PureComponent<JSX.IntrinsicElements['div']> &
AlignSelfProps &
OrderProps &
OverflowProps &
SpaceProps &
WidthProps &
MaxWidthProps &
MinWidthProps &
MaxHeightProps &
HeightProps &
MinHeightProps;
export const Div = styled.div<DivProps>(
{
boxSizing: 'border-box',
},
space,
width,
minWidth,
maxWidth,
height,
minHeight,
maxHeight,
order,
alignSelf,
overflow,
themed('container')
);