We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a3a465 commit 6d8ad98Copy full SHA for 6d8ad98
src/copy/index.tsx
@@ -1,7 +1,7 @@
1
import React, { CSSProperties, ReactNode } from 'react';
2
+import { CopyUtils } from '@dtinsight/dt-utils';
3
import { message, Tooltip } from 'antd';
4
import classNames from 'classnames';
-import useClippy from 'use-clippy';
5
6
import { LabelTooltipType, toTooltipProps } from '../utils';
7
import './style.scss';
@@ -40,11 +40,9 @@ const Copy: React.FC<ICopyProps> = (props) => {
40
className,
41
onCopy = () => message.success('复制成功'),
42
} = props;
43
- const [_, setClipboard] = useClippy();
44
45
const handleCopy = () => {
46
- setClipboard(text);
47
- onCopy(text);
+ new CopyUtils().copy(text, () => onCopy(text));
48
};
49
50
const renderCopyButton = () => (
0 commit comments