usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

useCopyToClipboard: copy method not returning promise

Open kendrickw opened this issue 1 year ago • 0 comments

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>
  );
}

kendrickw avatar Jun 20 '24 14:06 kendrickw