Skip to content

Commit

Permalink
docs(auto-docs): 自动生成文档时,memo 后的组件丢失 displayName
Browse files Browse the repository at this point in the history
  • Loading branch information
xyy94813 committed Nov 29, 2023
1 parent 3ef01fa commit 1708207
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/components/AMapControlBar/AMapControlBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ const AMapControlBar: FC<AMapControlBarProps> = ({

AMapControlBar.defaultProps = defaultProps;

export default memo(AMapControlBar);
const AMapControlBarMemo = memo(AMapControlBar);

AMapControlBarMemo.displayName = 'AMapControlBar'; // for auto-docs

export default AMapControlBarMemo;
6 changes: 5 additions & 1 deletion src/components/AMapHawkEye/AMapHawkEye.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,8 @@ const AMapHawkEye: FC<AMapHawkEyeProps> = ({

AMapHawkEye.defaultProps = defaultProps;

export default memo(AMapHawkEye);
const AMapHawkEyeMemo = memo(AMapHawkEye);

AMapHawkEyeMemo.displayName = 'AMapHawkEye'; // for auto-docs

export default AMapHawkEyeMemo;
6 changes: 5 additions & 1 deletion src/components/AMapMap/AMapMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,8 @@ const AMapMap = forwardRef<any, PropsWithChildren<AMapMapProps>>(

AMapMap.defaultProps = defaultProps;

export default memo(AMapMap);
const AMapMapMemo = memo(AMapMap);

AMapMapMemo.displayName = 'AMapMap'; // for auto-docs

export default AMapMapMemo;
2 changes: 0 additions & 2 deletions src/components/AMapMap/stories/AMapMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { AMapMap } from '../../../index';
import withAMapContainer from '../../../storybook-decorators/withAMapContainer';
import withAPIContainer from '../../../storybook-decorators/withAPIContainer';

AMapMap.displayName = 'AMapMap';

const meta: Meta<typeof AMapMap> = {
title: '组件(Components)/基础组件(Basic)/AMapMap',
component: AMapMap,
Expand Down
6 changes: 5 additions & 1 deletion src/components/AMapScale/AMapScale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ const AMapScale: FC<AMapScaleProps> = ({

AMapScale.defaultProps = defaultProps;

export default memo(AMapScale);
const AMapScaleMemo = memo(AMapScale);

AMapScaleMemo.displayName = 'AMapScale'; // for auto-docs

export default AMapScaleMemo;
6 changes: 5 additions & 1 deletion src/components/AMapToolBar/AMapToolBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ const AMapToolBar: FC<AMapToolBarProps> = ({

AMapToolBar.defaultProps = defaultProps;

export default memo(AMapToolBar);
const AMapToolBarMemo = memo(AMapToolBar);

AMapToolBarMemo.displayName = 'AMapToolBar'; // for auto-docs

export default AMapToolBarMemo;

0 comments on commit 1708207

Please sign in to comment.