react -slick copy to clipboard code example
Example 1: how to copy to clipboard in react js
<button
onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
>
Copy
</button>
Example 2: react copy to clipboard
onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}