The way to copy anything to clipboard
- First install the package with
npm
orYarn
.
#npm
npm install handy-copy-to-clipboard
#or with yarn
yarn add handy-copy-to-clipboard
- And here comes the fun part.
import Copy from 'handy-copy-to-clipboard'
Copy({
value: 'What you want to copy',
done: () => {
console.log('Callback function called')
}
})
Thanks for reading!!