File tree 3 files changed +45
-37
lines changed
3 files changed +45
-37
lines changed Original file line number Diff line number Diff line change @@ -62,22 +62,27 @@ const getCircleStyle = (
62
62
} ;
63
63
} ;
64
64
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
+
81
86
const mergedId = useId ( id ) ;
82
87
const gradientId = `${ mergedId } -gradient` ;
83
88
const radius = VIEW_BOX_SIZE / 2 - strokeWidth / 2 ;
@@ -233,8 +238,8 @@ const Circle: React.FC<ProgressProps> = ({
233
238
) ;
234
239
} ;
235
240
236
- Circle . defaultProps = defaultProps ;
237
-
238
- Circle . displayName = 'Circle' ;
241
+ if ( process . env . NODE_ENV !== 'production' ) {
242
+ Circle . displayName = 'Circle' ;
243
+ }
239
244
240
245
export default Circle ;
Original file line number Diff line number Diff line change @@ -3,19 +3,24 @@ import classNames from 'classnames';
3
3
import { useTransitionDuration , defaultProps } from './common' ;
4
4
import type { ProgressProps } from './interface' ;
5
5
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
+
19
24
// eslint-disable-next-line no-param-reassign
20
25
delete restProps . gapPosition ;
21
26
const percentList = Array . isArray ( percent ) ? percent : [ percent ] ;
@@ -92,8 +97,8 @@ const Line: React.FC<ProgressProps> = ({
92
97
) ;
93
98
} ;
94
99
95
- Line . defaultProps = defaultProps ;
96
-
97
- Line . displayName = 'Line' ;
100
+ if ( process . env . NODE_ENV !== 'production' ) {
101
+ Line . displayName = 'Line' ;
102
+ }
98
103
99
104
export default Line ;
Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ import { useRef, useEffect } from 'react';
2
2
import type { ProgressProps } from './interface' ;
3
3
4
4
export const defaultProps : Partial < ProgressProps > = {
5
- className : '' ,
6
5
percent : 0 ,
7
6
prefixCls : 'rc-progress' ,
8
7
strokeColor : '#2db7f5' ,
9
8
strokeLinecap : 'round' ,
10
9
strokeWidth : 1 ,
11
- style : { } ,
12
10
trailColor : '#D9D9D9' ,
13
11
trailWidth : 1 ,
14
12
gapPosition : 'bottom' ,
You can’t perform that action at this time.
0 commit comments