Skip to content

useCopyToClipboard: copy method not returning promise #312

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

Activity

added a commit that references this issue on Jun 20, 2024
9f83b2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @kendrickw

      Issue actions

        useCopyToClipboard: copy method not returning promise · Issue #312 · uidotdev/usehooks