mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 13:59:11 +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;
|