DEV Community

Cover image for Click to copy post url in
Rahul kumar
Rahul kumar

Posted on

Click to copy post url in

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.


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


Discussion (0)