Docs
useCopyToClipboard
Copy text to the clipboard easily with useCopyToClipboard, while keeping track of the most recently copied value.
Installation
Usage
API Reference
Returns
The useCopyToClipboard
hook returns a tuple with the following elements:
Index | Type | Description |
---|---|---|
0 | string | null | The copied text as string or null if nothing has been copied yet. |
1 | (text: string) => Promise<boolean> | Function to copy text to the clipboard. |