Как копировать текст в буфер обмена в React
onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}
Disgusted Dugong
onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}
// copy text on button click in react
const [textArea, setTextArea] = useState("THis is text")
const copyText = () => {
navigator.clipboard.writeText(textArea);
}