mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-12 11:55:23 +08:00
18 lines
432 B
TypeScript
18 lines
432 B
TypeScript
|
import React from 'react';
|
||
|
import { Button, Popconfirm } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const confirm = () =>
|
||
|
new Promise(resolve => {
|
||
|
setTimeout(() => resolve(null), 3000);
|
||
|
});
|
||
|
|
||
|
return (
|
||
|
<Popconfirm title="Title" onConfirm={confirm} onOpenChange={() => console.log('open change')}>
|
||
|
<Button type="primary">Open Popconfirm with Promise</Button>
|
||
|
</Popconfirm>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|