Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 613 Bytes

smooth-closed.md

File metadata and controls

36 lines (29 loc) · 613 Bytes
order title
7
zh-CN en-US
平滑地卸载
Smoothly Unmount

zh-CN

平滑、自然的卸载提示。

en-US

Smoothly unmount Alert upon close.

import React, { useState } from 'react';
import { Alert } from 'antd';

const App: React.FC = () => {
  const [visible, setVisible] = useState(true);
  const handleClose = () => {
    setVisible(false);
  };
  return (
    <div>
      {visible ? (
        <Alert message="Alert Message Text" type="success" closable afterClose={handleClose} />
      ) : null}
      <p>placeholder text here</p>
    </div>
  );
};

export default App;