mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
29 lines
513 B
TypeScript
29 lines
513 B
TypeScript
|
import React from 'react';
|
||
|
import { App, Button } from 'antd';
|
||
|
|
||
|
// Sub page
|
||
|
const MyPage = () => {
|
||
|
const { notification } = App.useApp();
|
||
|
|
||
|
const showNotification = () => {
|
||
|
notification.info({
|
||
|
message: `Notification topLeft`,
|
||
|
description: 'Hello, Ant Design!!',
|
||
|
placement: 'topLeft',
|
||
|
});
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<Button type="primary" onClick={showNotification}>
|
||
|
Open notification
|
||
|
</Button>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
// Entry component
|
||
|
export default () => (
|
||
|
<App>
|
||
|
<MyPage />
|
||
|
</App>
|
||
|
);
|