File tree Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -17,25 +17,7 @@ export interface DrawerProps
17
17
getContainer ?: PortalProps [ 'getContainer' ] ;
18
18
}
19
19
20
- // Default Value.
21
- // Since spread with default value will make this all over components.
22
- // Let's maintain this in one place.
23
- const defaultProps = {
24
- open : false ,
25
- prefixCls : 'rc-drawer' ,
26
- placement : 'right' as Placement ,
27
- autoFocus : true ,
28
- keyboard : true ,
29
- width : 378 ,
30
- mask : true ,
31
- maskClosable : true ,
32
- } ;
33
-
34
- const Drawer : React . FC < DrawerProps > = drawerProps => {
35
- const props = {
36
- ...defaultProps ,
37
- ...drawerProps ,
38
- } ;
20
+ const Drawer : React . FC < DrawerProps > = props => {
39
21
const {
40
22
open,
41
23
getContainer,
@@ -83,6 +65,20 @@ const Drawer: React.FC<DrawerProps> = drawerProps => {
83
65
) ;
84
66
} ;
85
67
68
+ // Default Value.
69
+ // Since spread with default value will make this all over components.
70
+ // Let's maintain this in one place.
71
+ Drawer . defaultProps = {
72
+ open : false ,
73
+ prefixCls : 'rc-drawer' ,
74
+ placement : 'right' ,
75
+ autoFocus : true ,
76
+ keyboard : true ,
77
+ width : 378 ,
78
+ mask : true ,
79
+ maskClosable : true ,
80
+ } ;
81
+
86
82
if ( process . env . NODE_ENV !== 'production' ) {
87
83
Drawer . displayName = 'Drawer' ;
88
84
}
You can’t perform that action at this time.
0 commit comments