/useClipboard

React hook for subscribing to clipboard

Primary LanguageJavaScriptMIT LicenseMIT

useClipboard

subscribes to clipboard

Note: This is using the new React Hooks API Proposal

Install

npm install useclipboard --save
  • Yarn
yarn add useclipboard 

Usage

import useClipboard from 'useclipboard';

function yourComponent() {
  let cliboard = useClipboard();
// { 
//     clipboardtext:text,
//     setText: function to update clipboardText,
//     syncClipboardText: function to sync cliboardText
// }

  // ...
}