Skip to content

Commit 088d99a

Browse files
committed
update demo
1 parent a2d04d4 commit 088d99a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/ant-design.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint no-console:0 */
22

33
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';
66
// use import Dialog from 'rc-dialog'
77
import Dialog from '../src/DialogWrap';
88

@@ -28,18 +28,18 @@ const getSvg = (path: string, props = {}, align = false) => {
2828
);
2929
};
3030

31-
class MyControl extends React.Component {
31+
class MyControl extends React.Component<any, any> {
3232
state = {
3333
visible: false,
3434
width: 600,
3535
destroyOnClose: false,
3636
center: false,
37-
mousePosition: {},
37+
mousePosition: undefined,
3838
useIcon: false,
3939
forceRender: false,
4040
};
4141

42-
onClick = e => {
42+
onClick = (e: React.MouseEvent) => {
4343
this.setState({
4444
mousePosition: {
4545
x: e.pageX,
@@ -49,19 +49,19 @@ class MyControl extends React.Component {
4949
});
5050
}
5151

52-
onClose = e => {
52+
onClose = (e: React.SyntheticEvent) => {
5353
this.setState({
5454
visible: false,
5555
});
5656
}
5757

58-
onDestroyOnCloseChange = e => {
58+
onDestroyOnCloseChange = (e: React.ChangeEvent<HTMLInputElement>) => {
5959
this.setState({
6060
destroyOnClose: e.target.checked,
6161
});
6262
}
6363

64-
onForceRenderChange = e => {
64+
onForceRenderChange = (e: React.ChangeEvent<HTMLInputElement>) => {
6565
this.setState({
6666
forceRender: e.target.checked,
6767
});
@@ -73,7 +73,7 @@ class MyControl extends React.Component {
7373
});
7474
}
7575

76-
center = e => {
76+
center = (e: React.ChangeEvent<HTMLInputElement>) => {
7777
this.setState({
7878
center: e.target.checked,
7979
});

0 commit comments

Comments
 (0)