mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-15 14:31:09 +08:00

* demo: use instead for tooltip's disabled demo * empty commit Co-authored-by: lijianan <574980606@qq.com> --------- Co-authored-by: lijianan <574980606@qq.com>
15 lines
368 B
TypeScript
15 lines
368 B
TypeScript
import React, { useState } from 'react';
|
|
import { Button, Tooltip } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [disabled, setDisabled] = useState(true);
|
|
|
|
return (
|
|
<Tooltip title={disabled ? null : 'prompt text'}>
|
|
<Button onClick={() => setDisabled(!disabled)}>{disabled ? 'Enable' : 'Disable'}</Button>
|
|
</Tooltip>
|
|
);
|
|
};
|
|
|
|
export default App;
|