Skip to content

useCopyToClipboard: copy method not returning promise #312

Open
@kendrickw

Description

@kendrickw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions