usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

fix: (useCopyToClipboard): copyToClipboard should return promise

Open kendrickw opened this issue 1 year ago • 2 comments

Fixes #312

The copyToClipboard function is not returning a promise currently. The intention (at least according to the function signature) is to fulfill the promise when the text is copied: https://github.com/uidotdev/usehooks/blob/90fbbb4cc085e74e50c36a62a5759a40c62bb98e/index.d.ts#L126-L129

This PR will change the code to return a promise. So the promise can fulfill when the text is copied successfully.

kendrickw avatar Jun 20 '24 14:06 kendrickw

Please merge this.

Currently this other npm lib has a working version: https://usehooks-ts.com/react-hook/use-copy-to-clipboard

tresorama avatar May 03 '25 15:05 tresorama

up

Sparebola avatar Jul 10 '25 09:07 Sparebola