1
1
/* eslint no-console:0 */
2
2
3
3
import 'rc-dialog/assets/index.less' ;
4
- import React from 'react' ;
5
- import ReactDOM from 'react-dom' ;
4
+ import * as React from 'react' ;
5
+ import * as ReactDOM from 'react-dom' ;
6
6
// use import Dialog from 'rc-dialog'
7
7
import Dialog from '../src/DialogWrap' ;
8
8
@@ -28,18 +28,18 @@ const getSvg = (path: string, props = {}, align = false) => {
28
28
) ;
29
29
} ;
30
30
31
- class MyControl extends React . Component {
31
+ class MyControl extends React . Component < any , any > {
32
32
state = {
33
33
visible : false ,
34
34
width : 600 ,
35
35
destroyOnClose : false ,
36
36
center : false ,
37
- mousePosition : { } ,
37
+ mousePosition : undefined ,
38
38
useIcon : false ,
39
39
forceRender : false ,
40
40
} ;
41
41
42
- onClick = e => {
42
+ onClick = ( e : React . MouseEvent ) => {
43
43
this . setState ( {
44
44
mousePosition : {
45
45
x : e . pageX ,
@@ -49,19 +49,19 @@ class MyControl extends React.Component {
49
49
} ) ;
50
50
}
51
51
52
- onClose = e => {
52
+ onClose = ( e : React . SyntheticEvent ) => {
53
53
this . setState ( {
54
54
visible : false ,
55
55
} ) ;
56
56
}
57
57
58
- onDestroyOnCloseChange = e => {
58
+ onDestroyOnCloseChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
59
59
this . setState ( {
60
60
destroyOnClose : e . target . checked ,
61
61
} ) ;
62
62
}
63
63
64
- onForceRenderChange = e => {
64
+ onForceRenderChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
65
65
this . setState ( {
66
66
forceRender : e . target . checked ,
67
67
} ) ;
@@ -73,7 +73,7 @@ class MyControl extends React.Component {
73
73
} ) ;
74
74
}
75
75
76
- center = e => {
76
+ center = ( e : React . ChangeEvent < HTMLInputElement > ) => {
77
77
this . setState ( {
78
78
center : e . target . checked ,
79
79
} ) ;
0 commit comments