copy an array to clipboard reactjs code example Example: react copy to clipboard onClick={() => {navigator.clipboard.writeText(this.state.textToCopy)}}