JSPM

react-twitter-share-link

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2188
  • Score
    100M100P100Q116859F
  • License MIT

Package Exports

  • react-twitter-share-link

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-twitter-share-link) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-twitter-share-link

Create "share this on Twitter" links in React.

Installation

With npm:

npm install --save react-twitter-share-link

Or with Yarn:

yarn add react-twitter-share-link

Usage

import ShareLink from 'react-twitter-share-link'

...

<ShareLink link='https://your-site.com/some-page'>
   {link => (
      <a href={link} target='_blank'>Share this on Twitter</a>
   )}
</ShareLink>

If you don't pass in a link prop, it will use the current page (window.location.href).