Component Wrapper for Copy to Clipboard Button with React
% npm install react-copy-button-wrapper
<ReactCopyButtonWrapper text='test'>
<button>Copy</button>
</ReactCopyButtonWrapper>
Please look at /example
directory.
Demo page is here: http://pastak.github.io/react-copy-button-wrapper/example/example.html
Firefox, Chrome, Opera, IE9+ works with Selection API and execCommand
It works with react-zeroclipboard which is relies on zeroclipboard.
It depends on Flash!!!!!!!!!!!!
It works with window.clipboardData.setData
Clipboard API was comming to modern browsers and clipboard.js is great solution. However Safari and old browsers don't support yet.
Zeroclipboard is solution for all browsers but it's not better because depends on flash...
And some react components for copy buttons ( for example react-copy-to-clipboard react-clipboard ) have only support for modern browsers.
This component's goal is that works with modern browsers and safari and old-IE.