fix: add displayName (#40092)

* fix: add displayName

* rerun ci

* rerun ci
This commit is contained in:
lijianan 2023-01-08 21:30:41 +08:00 committed by GitHub
parent 130c22ab03
commit 8501adbd84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 166 additions and 6 deletions

View File

@ -68,4 +68,8 @@ const Wave: React.FC<WaveProps> = (props) => {
return cloneElement(children, { ref });
};
if (process.env.NODE_ENV !== 'production') {
Wave.displayName = 'Wave';
}
export default Wave;

View File

@ -207,4 +207,8 @@ const Alert: CompoundedComponent = ({
Alert.ErrorBoundary = ErrorBoundary;
if (process.env.NODE_ENV !== 'production') {
Alert.displayName = 'Alert';
}
export default Alert;

View File

@ -349,4 +349,8 @@ const Anchor: React.FC<AnchorProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Anchor.displayName = 'Anchor';
}
export default Anchor;

View File

@ -180,4 +180,8 @@ const PurePanel = genPurePanel(RefAutoComplete);
RefAutoComplete.Option = Option;
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (process.env.NODE_ENV !== 'production') {
AutoComplete.displayName = 'AutoComplete';
}
export default RefAutoComplete;

View File

@ -111,4 +111,8 @@ const BackTop: React.FC<BackTopProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
BackTop.displayName = 'BackTop';
}
export default React.memo(BackTop);

View File

@ -18,7 +18,7 @@ export interface RibbonProps {
placement?: RibbonPlacement;
}
const Ribbon: React.FC<RibbonProps> = function Ribbon({
const Ribbon: React.FC<RibbonProps> = ({
className,
prefixCls: customizePrefixCls,
style,
@ -26,7 +26,7 @@ const Ribbon: React.FC<RibbonProps> = function Ribbon({
children,
text,
placement = 'end',
}) {
}) => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('ribbon', customizePrefixCls);
const colorInPreset = isPresetColor(color, false);
@ -57,4 +57,8 @@ const Ribbon: React.FC<RibbonProps> = function Ribbon({
);
};
if (process.env.NODE_ENV !== 'production') {
Ribbon.displayName = 'Ribbon';
}
export default Ribbon;

View File

@ -243,4 +243,8 @@ const Badge: CompoundedComponent = ({
Badge.Ribbon = Ribbon;
if (process.env.NODE_ENV !== 'production') {
Badge.displayName = 'Badge';
}
export default Badge;

View File

@ -163,7 +163,10 @@ const Breadcrumb: CompoundedComponent = ({
};
Breadcrumb.Item = BreadcrumbItem;
Breadcrumb.Separator = BreadcrumbSeparator;
if (process.env.NODE_ENV !== 'production') {
Breadcrumb.displayName = 'Breadcrumb';
}
export default Breadcrumb;

View File

@ -290,6 +290,10 @@ function generateCalendar<DateType>(generateConfig: GenerateConfig<DateType>) {
);
};
if (process.env.NODE_ENV !== 'production') {
Calendar.displayName = 'Calendar';
}
return Calendar;
}

View File

@ -18,4 +18,8 @@ const Card = InternalCard as CardInterface;
Card.Grid = Grid;
Card.Meta = Meta;
if (process.env.NODE_ENV !== 'production') {
Card.displayName = 'Card';
}
export default Card;

View File

@ -112,4 +112,8 @@ const Carousel = React.forwardRef<CarouselRef, CarouselProps>(
},
);
if (process.env.NODE_ENV !== 'production') {
Carousel.displayName = 'Carousel';
}
export default Carousel;

View File

@ -19,4 +19,8 @@ const Checkbox = InternalCheckbox as CompoundedComponent;
Checkbox.Group = Group;
Checkbox.__ANT_CHECKBOX = true;
if (process.env.NODE_ENV !== 'production') {
Checkbox.displayName = 'Checkbox';
}
export default Checkbox;

View File

@ -145,4 +145,8 @@ const Collapse: CompoundedComponent = (props) => {
Collapse.Panel = CollapsePanel;
if (process.env.NODE_ENV !== 'production') {
Collapse.displayName = 'Collapse';
}
export default Collapse;

View File

@ -326,4 +326,8 @@ ConfigProvider.ConfigContext = ConfigContext;
ConfigProvider.SizeContext = SizeContext;
ConfigProvider.config = setGlobalConfig;
if (process.env.NODE_ENV !== 'production') {
ConfigProvider.displayName = 'ConfigProvider';
}
export default ConfigProvider;

View File

@ -202,6 +202,10 @@ function Descriptions({
);
}
if (process.env.NODE_ENV !== 'production') {
Descriptions.displayName = 'Descriptions';
}
Descriptions.Item = DescriptionsItem;
export default Descriptions;

View File

@ -79,4 +79,8 @@ const Divider: React.FC<DividerProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Divider.displayName = 'Divider';
}
export default Divider;

View File

@ -307,4 +307,8 @@ const WrapPurePanel = (props: DropdownProps) => (
Dropdown._InternalPanelDoNotUseOrYouWillBeFired = WrapPurePanel;
if (process.env.NODE_ENV !== 'production') {
Dropdown.displayName = 'Dropdown';
}
export default Dropdown;

View File

@ -86,4 +86,8 @@ const Empty: CompoundedComponent = ({
Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
if (process.env.NODE_ENV !== 'production') {
Empty.displayName = 'Empty';
}
export default Empty;

View File

@ -82,4 +82,8 @@ const BackTop: React.FC<BackTopProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
BackTop.displayName = 'BackTop';
}
export default memo(BackTop);

View File

@ -68,4 +68,8 @@ export { ImageProps };
Image.PreviewGroup = PreviewGroup;
if (process.env.NODE_ENV !== 'production') {
Image.displayName = 'Image';
}
export default Image;

View File

@ -232,6 +232,10 @@ const PureInputNumber = (props: InputNumberProps<any>) => (
</ConfigProvider>
);
if (process.env.NODE_ENV !== 'production') {
TypedInputNumber.displayName = 'InputNumber';
}
TypedInputNumber._InternalPanelDoNotUseOrYouWillBeFired = PureInputNumber;
export default TypedInputNumber;

View File

@ -23,6 +23,10 @@ type CompoundedComponent = React.ForwardRefExoticComponent<
const Input = InternalInput as CompoundedComponent;
if (process.env.NODE_ENV !== 'production') {
Input.displayName = 'Input';
}
Input.Group = Group;
Input.Search = Search;
Input.TextArea = TextArea;

View File

@ -294,6 +294,10 @@ function List<T>({
);
}
if (process.env.NODE_ENV !== 'production') {
List.displayName = 'List';
}
List.Item = Item;
export default List;

View File

@ -87,4 +87,8 @@ const LocaleProvider: React.FC<LocaleProviderProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
LocaleProvider.displayName = 'LocaleProvider';
}
export default LocaleProvider;

View File

@ -46,4 +46,8 @@ Menu.SubMenu = SubMenu;
Menu.Divider = MenuDivider;
Menu.ItemGroup = ItemGroup;
if (process.env.NODE_ENV !== 'production') {
Menu.displayName = 'Menu';
}
export default Menu;

View File

@ -65,4 +65,8 @@ Modal.config = modalGlobalConfig;
Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (process.env.NODE_ENV !== 'production') {
Modal.displayName = 'Modal';
}
export default Modal;

View File

@ -125,4 +125,8 @@ const Pagination: React.FC<PaginationProps> = ({
);
};
if (process.env.NODE_ENV !== 'production') {
Pagination.displayName = 'Pagination';
}
export default Pagination;

View File

@ -135,4 +135,8 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
/* istanbul ignore next */
Popconfirm._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (process.env.NODE_ENV !== 'production') {
Popconfirm.displayName = 'Popconfirm';
}
export default Popconfirm;

View File

@ -183,4 +183,8 @@ const Progress: React.FC<ProgressProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Progress.displayName = 'Progress';
}
export default Progress;

View File

@ -97,4 +97,8 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
QRCode.displayName = 'QRCode';
}
export default QRCode;

View File

@ -146,4 +146,8 @@ Result.PRESENTED_IMAGE_403 = ExceptionMap['403'];
Result.PRESENTED_IMAGE_404 = ExceptionMap['404'];
Result.PRESENTED_IMAGE_500 = ExceptionMap['500'];
if (process.env.NODE_ENV !== 'production') {
Result.displayName = 'Result';
}
export default Result;

View File

@ -1,6 +1,6 @@
import * as React from 'react';
const NoFound = () => (
const NoFound: React.FC = () => (
<svg width="252" height="294">
<defs>
<path d="M0 .387h251.772v251.772H0z" />

View File

@ -1,6 +1,6 @@
import * as React from 'react';
const ServerError = () => (
const ServerError: React.FC = () => (
<svg width="254" height="294">
<defs>
<path d="M0 .335h253.49v253.49H0z" />

View File

@ -1,6 +1,6 @@
import * as React from 'react';
const Unauthorized = () => (
const Unauthorized: React.FC = () => (
<svg width="251" height="294">
<g fill="none" fillRule="evenodd">
<path

View File

@ -230,6 +230,10 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
);
};
if (process.env.NODE_ENV !== 'production') {
InternalSelect.displayName = 'Select';
}
const Select = React.forwardRef(InternalSelect) as unknown as (<
ValueType = any,
OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType,

View File

@ -186,4 +186,8 @@ Skeleton.Input = SkeletonInput;
Skeleton.Image = SkeletonImage;
Skeleton.Node = SkeletonNode;
if (process.env.NODE_ENV !== 'production') {
Skeleton.displayName = 'Skeleton';
}
export default Skeleton;

View File

@ -151,11 +151,16 @@ const Space: React.FC<SpaceProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Space.displayName = 'Space';
}
type CompoundedComponent = React.FC<SpaceProps> & {
Compact: typeof Compact;
};
const CompoundedSpace = Space as CompoundedComponent;
CompoundedSpace.Compact = Compact;
export default CompoundedSpace;

View File

@ -84,6 +84,10 @@ const Statistic: React.FC<StatisticProps> & CompoundedComponent = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Statistic.displayName = 'Statistic';
}
Statistic.Countdown = Countdown;
export default Statistic;

View File

@ -136,4 +136,8 @@ const Steps: CompoundedComponent = (props) => {
Steps.Step = RcSteps.Step;
if (process.env.NODE_ENV !== 'production') {
Steps.displayName = 'Steps';
}
export default Steps;

View File

@ -105,4 +105,8 @@ function Tabs({
Tabs.TabPane = TabPane;
if (process.env.NODE_ENV !== 'production') {
Tabs.displayName = 'Tabs';
}
export default Tabs;

View File

@ -107,4 +107,8 @@ const Timeline: CompoundedComponent = (props) => {
Timeline.Item = TimelineItem;
if (process.env.NODE_ENV !== 'production') {
Timeline.displayName = 'Timeline';
}
export default Timeline;

View File

@ -248,4 +248,8 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
);
});
if (process.env.NODE_ENV !== 'production') {
Tree.displayName = 'Tree';
}
export default Tree;

View File

@ -246,4 +246,8 @@ const Watermark: React.FC<WatermarkProps> = (props) => {
);
};
if (process.env.NODE_ENV !== 'production') {
Watermark.displayName = 'Watermark';
}
export default Watermark;