DEV Community

Cover image for Click to copy post url in @dsabyte.com
Rahul kumar
Rahul kumar

Posted on

Click to copy post url in @dsabyte.com

I have used copy-to-clipboard library to copy text to clipboard.

Go here and scroll down. At the bottom, you'll see a share icon. On clicking on that icon, you'll see copy icon.

Implemention

import copy from "copy-to-clipboard";
const copyUrl = (url) => {
    let copied = copy(url);
    if (copied) {
       // show message
    }
};
Enter fullscreen mode Exit fullscreen mode

Thanku

Top comments (0)