1.0.1 • Published 3 years ago

react-use-copy-to-clipboard v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-use-copy-to-clipboard

NPM JavaScript Style Guide

Install

npm install --save react-use-copy-to-clipboard

Usage

import React from "react";
import {useCopyToClipboard} from "react-use-copy-to-clipboard";

export const CopyButton = ({text}) => {
  const clickRef = useCopyToClipboard(text,
    () => console.log("Copyed!"),
    () => console.log("Unable to copy!"))
  return (
    <button ref={clickRef}>Copy!</button>
  )
}

License

MIT © code0-st


This hook is created using create-react-hook.