uidotdev / usehooks

A collection of modern, server-safe React hooks – from the ui.dev team
https://usehooks.com
MIT License
9.52k stars 500 forks source link

useCopyToClipboard: copy method not returning promise #312

Open kendrickw opened 4 months ago

kendrickw commented 4 months ago

The copyToClipboard function is not returning a promise after copying text, see:

export default function App() {
  const [copiedText, copyToClipboard] = useCopyToClipboard();

  return (
    <button
      onClick={() => {
        copyToClipboard('text').then(() => {
          console.log('never gets here');
        });
      }}
    >
      copy
    </button>
  );
}