# react-twitter-share-link

> Create "share this on Twitter" links in React.

Latest version **1.2.1** (published 2019-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-twitter-share-link
pnpm add react-twitter-share-link
yarn add react-twitter-share-link
bun add react-twitter-share-link
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-03-11 |
| First published | 2018-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kennedy Rose |
| Maintainers | ken85rose, suhay, tbaustin |
| Keywords | react, twitter, share, link |

## Links

- npm: https://www.npmjs.com/package/react-twitter-share-link
- Repository: https://github.com/escaladesports/react-twitter-share-link
- Homepage: https://github.com/escaladesports/react-twitter-share-link#readme
- Issues: https://github.com/escaladesports/react-twitter-share-link/issues
- npm.io page: https://npm.io/package/react-twitter-share-link

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2
- [styled-jsx](https://npm.io/package/styled-jsx.md) ^2.2.6
- [query-string](https://npm.io/package/query-string.md) ^5.1.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.26.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2019-03-11
- 1.2.0 — 2018-09-04
- 1.1.1 — 2018-07-30
- 1.0.2 — 2018-07-06
- 1.0.1 — 2018-06-29
- 1.0.0 — 2018-06-04

## README

# react-twitter-share-link

Create "share this on Twitter" links in React.

## Installation

With npm:

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

Or with Yarn:

```bash
yarn add react-twitter-share-link
```

## Usage

```jsx
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>
```

## ShareLink Properties

| Name              |  Type             | Default                | Description |
|-------------------|-------------------|------------------------|-------------|
| link              | string            | document.location.href | link the tweet will reference to |
| text              | string            | null                   | text before the link |
| hashtags          | string / string[] | null                   | hashtags with comma or space separated string "twitter,twitterdev" / "twitter twitterdev" or array ["twitter","twitterdev"] |
| via               | string            | null                   | via references a user account at the end of the tweet (e.g "via @twitter") |
| related           | string / string[] | null                   | related accounts with comma or space separated string "twitter,twitterdev" / "twitter twitterdev" or array ["twitter","twitterdev"] |
| customQueryParams | string / object   | null                   | ability to add custom query params to the tweet url  |

---
_Source: https://npm.io/package/react-twitter-share-link · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
