Copiar texto al portapapeles JavaScript React
onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}
Disgusted Dugong
onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}
<button
onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
>
Copy
</button>
<buttononClick={() => navigator.clipboard.writeText("Copy this text to clipboard")}>
Copy
</button>
<button
onClick={() => navigator.clipboard.writeText('Copy this text to clipboard')}
>
Copy
</button>