1<button
2 onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
3>
4 Copy
5</button>
1<button
2 onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
3>
4 Copy
5</button>
6
1onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}
2
3<button onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
4>
5 Copy
6</button>