File tree Expand file tree Collapse file tree 3 files changed +45
-37
lines changed Expand file tree Collapse file tree 3 files changed +45
-37
lines changed Original file line number Diff line number Diff line change @@ -62,22 +62,27 @@ const getCircleStyle = (
6262 } ;
6363} ;
6464
65- const Circle : React . FC < ProgressProps > = ( {
66- id,
67- prefixCls,
68- steps,
69- strokeWidth,
70- trailWidth,
71- gapDegree = 0 ,
72- gapPosition,
73- trailColor,
74- strokeLinecap,
75- style,
76- className,
77- strokeColor,
78- percent,
79- ...restProps
80- } ) => {
65+ const Circle : React . FC < ProgressProps > = ( props ) => {
66+ const {
67+ id,
68+ prefixCls,
69+ steps,
70+ strokeWidth,
71+ trailWidth,
72+ gapDegree = 0 ,
73+ gapPosition,
74+ trailColor,
75+ strokeLinecap,
76+ style,
77+ className,
78+ strokeColor,
79+ percent,
80+ ...restProps
81+ } = {
82+ ...defaultProps ,
83+ ...props ,
84+ } ;
85+
8186 const mergedId = useId ( id ) ;
8287 const gradientId = `${ mergedId } -gradient` ;
8388 const radius = VIEW_BOX_SIZE / 2 - strokeWidth / 2 ;
@@ -233,8 +238,8 @@ const Circle: React.FC<ProgressProps> = ({
233238 ) ;
234239} ;
235240
236- Circle . defaultProps = defaultProps ;
237-
238- Circle . displayName = 'Circle' ;
241+ if ( process . env . NODE_ENV !== 'production' ) {
242+ Circle . displayName = 'Circle' ;
243+ }
239244
240245export default Circle ;
Original file line number Diff line number Diff line change @@ -3,19 +3,24 @@ import classNames from 'classnames';
33import { useTransitionDuration , defaultProps } from './common' ;
44import type { ProgressProps } from './interface' ;
55
6- const Line : React . FC < ProgressProps > = ( {
7- className,
8- percent,
9- prefixCls,
10- strokeColor,
11- strokeLinecap,
12- strokeWidth,
13- style,
14- trailColor,
15- trailWidth,
16- transition,
17- ...restProps
18- } ) => {
6+ const Line : React . FC < ProgressProps > = ( props ) => {
7+ const {
8+ className,
9+ percent,
10+ prefixCls,
11+ strokeColor,
12+ strokeLinecap,
13+ strokeWidth,
14+ style,
15+ trailColor,
16+ trailWidth,
17+ transition,
18+ ...restProps
19+ } = {
20+ ...defaultProps ,
21+ ...props ,
22+ } ;
23+
1924 // eslint-disable-next-line no-param-reassign
2025 delete restProps . gapPosition ;
2126 const percentList = Array . isArray ( percent ) ? percent : [ percent ] ;
@@ -92,8 +97,8 @@ const Line: React.FC<ProgressProps> = ({
9297 ) ;
9398} ;
9499
95- Line . defaultProps = defaultProps ;
96-
97- Line . displayName = 'Line' ;
100+ if ( process . env . NODE_ENV !== 'production' ) {
101+ Line . displayName = 'Line' ;
102+ }
98103
99104export default Line ;
Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ import { useRef, useEffect } from 'react';
22import type { ProgressProps } from './interface' ;
33
44export const defaultProps : Partial < ProgressProps > = {
5- className : '' ,
65 percent : 0 ,
76 prefixCls : 'rc-progress' ,
87 strokeColor : '#2db7f5' ,
98 strokeLinecap : 'round' ,
109 strokeWidth : 1 ,
11- style : { } ,
1210 trailColor : '#D9D9D9' ,
1311 trailWidth : 1 ,
1412 gapPosition : 'bottom' ,
You can’t perform that action at this time.
0 commit comments