Browse Source

fix: add displayName (#40092)

* fix: add displayName

* rerun ci

* rerun ci
pull/40096/head
lijianan 2 years ago
committed by GitHub
parent
commit
8501adbd84
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/_util/wave/index.ts
  2. 4
      components/alert/index.tsx
  3. 4
      components/anchor/Anchor.tsx
  4. 4
      components/auto-complete/index.tsx
  5. 4
      components/back-top/index.tsx
  6. 8
      components/badge/Ribbon.tsx
  7. 4
      components/badge/index.tsx
  8. 5
      components/breadcrumb/Breadcrumb.tsx
  9. 4
      components/calendar/generateCalendar.tsx
  10. 4
      components/card/index.ts
  11. 4
      components/carousel/index.tsx
  12. 4
      components/checkbox/index.ts
  13. 4
      components/collapse/Collapse.tsx
  14. 4
      components/config-provider/index.tsx
  15. 4
      components/descriptions/index.tsx
  16. 4
      components/divider/index.tsx
  17. 4
      components/dropdown/dropdown.tsx
  18. 4
      components/empty/index.tsx
  19. 4
      components/float-button/BackTop.tsx
  20. 4
      components/image/index.tsx
  21. 4
      components/input-number/index.tsx
  22. 4
      components/input/index.ts
  23. 4
      components/list/index.tsx
  24. 4
      components/locale/index.tsx
  25. 4
      components/menu/index.tsx
  26. 4
      components/modal/index.tsx
  27. 4
      components/pagination/Pagination.tsx
  28. 4
      components/popconfirm/index.tsx
  29. 4
      components/progress/progress.tsx
  30. 4
      components/qrcode/index.tsx
  31. 4
      components/result/index.tsx
  32. 2
      components/result/noFound.tsx
  33. 2
      components/result/serverError.tsx
  34. 2
      components/result/unauthorized.tsx
  35. 4
      components/select/index.tsx
  36. 4
      components/skeleton/Skeleton.tsx
  37. 5
      components/space/index.tsx
  38. 4
      components/statistic/Statistic.tsx
  39. 4
      components/steps/index.tsx
  40. 4
      components/tabs/index.tsx
  41. 4
      components/timeline/Timeline.tsx
  42. 4
      components/tree/Tree.tsx
  43. 4
      components/watermark/index.tsx

4
components/_util/wave/index.ts

@ -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;

4
components/alert/index.tsx

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

4
components/anchor/Anchor.tsx

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

4
components/auto-complete/index.tsx

@ -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;

4
components/back-top/index.tsx

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

8
components/badge/Ribbon.tsx

@ -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;

4
components/badge/index.tsx

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

5
components/breadcrumb/Breadcrumb.tsx

@ -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;

4
components/calendar/generateCalendar.tsx

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

4
components/card/index.ts

@ -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;

4
components/carousel/index.tsx

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

4
components/checkbox/index.ts

@ -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;

4
components/collapse/Collapse.tsx

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

4
components/config-provider/index.tsx

@ -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;

4
components/descriptions/index.tsx

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

4
components/divider/index.tsx

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

4
components/dropdown/dropdown.tsx

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

4
components/empty/index.tsx

@ -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;

4
components/float-button/BackTop.tsx

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

4
components/image/index.tsx

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

4
components/input-number/index.tsx

@ -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;

4
components/input/index.ts

@ -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;

4
components/list/index.tsx

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

4
components/locale/index.tsx

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

4
components/menu/index.tsx

@ -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;

4
components/modal/index.tsx

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

4
components/pagination/Pagination.tsx

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

4
components/popconfirm/index.tsx

@ -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;

4
components/progress/progress.tsx

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

4
components/qrcode/index.tsx

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

4
components/result/index.tsx

@ -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;

2
components/result/noFound.tsx

@ -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" />

2
components/result/serverError.tsx

@ -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" />

2
components/result/unauthorized.tsx

@ -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

4
components/select/index.tsx

@ -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,

4
components/skeleton/Skeleton.tsx

@ -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;

5
components/space/index.tsx

@ -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;

4
components/statistic/Statistic.tsx

@ -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;

4
components/steps/index.tsx

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

4
components/tabs/index.tsx

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

4
components/timeline/Timeline.tsx

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

4
components/tree/Tree.tsx

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

4
components/watermark/index.tsx

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

Loading…
Cancel
Save