Hooks
useShareButton
Custom hook to share links
Setup
Create a new file called useShareButton.ts in your hooks directory:
hooks/useShareButton.ts
Usage
Props
| Name | Type | Default | Description |
|---|---|---|---|
link | string | "" | The link to be shared |
isCopied | boolean | false | Whether the link has been copied |
copyToClipboard | () => Promise<void> | () => {} | Function to copy the link to the clipboard |