ant-design/components/popconfirm/demo/basic.tsx
afc163 74d5718ee7
demo: update popconfirm demo (#42429)
* demo: update popconfirm demo

* demo: update snapshot
2023-05-17 12:00:49 +08:00

28 lines
588 B
TypeScript

import { Button, message, Popconfirm } from 'antd';
import React from 'react';
const confirm = (e: React.MouseEvent<HTMLElement>) => {
console.log(e);
message.success('Click on Yes');
};
const cancel = (e: React.MouseEvent<HTMLElement>) => {
console.log(e);
message.error('Click on No');
};
const App: React.FC = () => (
<Popconfirm
title="Delete the task"
description="Are you sure to delete this task?"
onConfirm={confirm}
onCancel={cancel}
okText="Yes"
cancelText="No"
>
<Button danger>Delete</Button>
</Popconfirm>
);
export default App;