import React, { useMemo } from 'react';
import { Button, message } from 'antd';
const Context = React.createContext({ name: 'Default' });
const App: React.FC = () => {
const [messageApi, contextHolder] = message.useMessage();
const info = () => {
messageApi.open({
type: 'info',
content: {({ name }) => `Hello, ${name}!`},
duration: 1,
});
};
const contextValue = useMemo(() => ({ name: 'Ant Design' }), []);
return (
{contextHolder}
);
};
export default App;