mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
6998f66eb5
- add afterClose to Alert, in in order to achieve smoothly unmount.
743 B
743 B
order | title | ||||
---|---|---|---|---|---|
7 |
|
zh-CN
平滑、自然的卸载提示
en-US
Smoothly and unaffectedly unmount Alert.
import { Alert } from 'antd';
class App extends React.Component {
state = {
visiable: true,
}
handleClose = () => {
this.setState({ visiable: false });
}
render() {
return (
<div>
{
this.state.visiable ? (
<Alert
message="Alert Message Text"
type="success"
closable
afterClose={this.handleClose}
/>
) : null
}
<p>placeholder text here</p>
</div>
);
}
}
ReactDOM.render(
<App />
, mountNode);