Socket
Socket
Sign inDemoInstall

@lokibai/react-use-copy-clipboard

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lokibai/react-use-copy-clipboard

copy to clipboard


Version published
Weekly downloads
87
increased by180.65%
Maintainers
1
Install size
18.0 kB
Created
Weekly downloads
 

Readme

Source

@lokibai/react-use-copy-clipboard

copy to clipboard

NPM JavaScript Style Guide

Install

npm install --save @lokibai/react-use-copy-clipboard

Usage

import React from 'react';
import { useCopyClipboard } from '@lokibai/react-use-copy-clipboard';

const App = () => {
	const [isCopied, setCopied] = useCopyClipboard('initial text');

	const handleClick = () => {
		// setCopied('text');
		setCopied();
	};

	return (
		<button onClick={handleClick}>Was it copied? {isCopied ? 'Yes! 👍' : 'Nope! 👎'}</button>
	);
};

License

MIT ©


This hook is created using create-react-library.

FAQs

Last updated on 03 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc