-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathformError.tsx
53 lines (46 loc) · 1.04 KB
/
formError.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import Tooltip from 'rc-tooltip';
import React, { Component } from 'react';
import '../../assets/bootstrap.less';
interface TestState {
open: boolean;
destroy?: boolean;
}
class Test extends Component {
state = {
open: false,
} as TestState;
handleDestroy = () => {
this.setState({
destroy: true,
});
};
handleChange = (e) => {
this.setState({
visible: !e.target.value,
});
};
render() {
if (this.state.destroy) {
return null;
}
return (
<div>
<div style={{ marginTop: 100, marginLeft: 100, marginBottom: 100 }}>
<Tooltip
open={this.state.open}
motion={{ motionName: 'rc-tooltip-zoom' }}
trigger={[]}
overlayStyle={{ zIndex: 1000 }}
overlay={<span>required!</span>}
>
<input onChange={this.handleChange} />
</Tooltip>
</div>
<button type="button" onClick={this.handleDestroy}>
destroy
</button>
</div>
);
}
}
export default Test;