import { useCopyToClipboard } from "https://deno.land/x/netzo@0.5.63/deps/usehooks-ts.ts";
Custom hook for copying text to the clipboard.
Examples
// Usage of useCopyToClipboard hook
const [copiedText, copyToClipboard] = useCopyToClipboard();
const textToCopy = 'Hello, world!';
// Usage of useCopyToClipboard hook const [copiedText, copyToClipboard] = useCopyToClipboard(); const textToCopy = 'Hello, world!';
// Attempt to copy text to the clipboard
copyToClipboard(textToCopy)
.then(success => {
if (success) {
console.log(Text "${textToCopy}" copied to clipboard successfully.
);
} else {
console.error('Failed to copy text to clipboard.');
}
});