0.1.1 • Published 11 months ago

@wpdas/react-tweet v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Tweet - React Component

Build Status Build Size Version

A simple Tweet component for ReactJS apps.

Install

Install it using npm or yarn:

# npm
npm install @wpdas/react-tweet

# yarn
yarn add @wpdas/react-tweet

How to use

import { Tweet } from '@wpdas/react-tweet'

const App = () => {
  return (
    <>
      <Tweet
        tweetURL="https://twitter.com/wpdas/status/1648406388127801347"
        onRender={() => console.log('rendered')}
        onError={(err: string) => console.log(err)}
        options={{ theme: 'dark' }}
      />
    </>
  )
}

export default App

tweetURL: (must) this is the tweet URL

onRender: (optional) method called when the tweet renders

onError: (optional) method called when there's an issue with the provided URL

options: (optional) you can set some options like:

type Options = {
  conversation?: 'none' | 'all'
  cards?: 'hidden' | 'visible'
  linkColor?: string
  theme?: 'light' | 'dark'
}

How it looks after rendering:

Good to know

The component will be re-rendered when the tweetURL or options property is changed.

0.1.1

11 months ago

0.1.0

11 months ago