There is an error in the example provided in the README
<CopyToClipboard text={exampleText} on:copy={handleSuccessfullyCopied} on:fail={handleFailedCopy} let:onCopy>
<button on:click={onCopy}>An element to trigger the copy</button>
</CopyToClipboard>
should be (let:onCopy should be let:copy, and latter on:click={onCopy} should be on:click={copy})
<CopyToClipboard text={exampleText} on:copy={handleSuccessfullyCopied} on:fail={handleFailedCopy} let:copy>
<button on:click={copy}>An element to trigger the copy</button>
</CopyToClipboard>
There is an error in the example provided in the README
should be (
let:onCopy
should belet:copy
, and latteron:click={onCopy}
should beon:click={copy}
)