0.0.10 • Published 8 years ago
sharer.npm.js v0.0.10
Sharer.npm.js
Sharer.npm.js is the node package module for Sharer.js. Checkout the official docs page for more info.
Installing
npm install sharer.npm.js
Usage
(sample using with react)
import Sharer from 'sharer.npm.js';
class Sample extends React.Component {
handleClick(e) {
const sharer = new Sharer(e.target)
sharer.share()
}
render() {
return (
<button
onClick={::this.handleClick}
className='sharer button'
data-sharer='twitter'
data-title='Checkout Sharer.js!'
data-url='https://ellisonleao.github.io/sharer.js/'>
Share on Twitter
</button>
)
}
}