mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
52d2b41f9d
* chore: update message hooks demo * chore: update message hooks demo
22 lines
400 B
TypeScript
22 lines
400 B
TypeScript
import React from 'react';
|
|
import { Button, message } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [messageApi, contextHolder] = message.useMessage();
|
|
|
|
const info = () => {
|
|
messageApi.info('Hello, Ant Design!');
|
|
};
|
|
|
|
return (
|
|
<>
|
|
{contextHolder}
|
|
<Button type="primary" onClick={info}>
|
|
Display normal message
|
|
</Button>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|