ft-interactive/react-twitter-widgets

Name: react-twitter-widgets

Owner: FT Interactive News

Description: Twitter widgets as React components

Forked from: andrewsuzuki/react-twitter-widgets

Created: 2017-01-26 16:59:18.0

Updated: 2017-01-26 16:59:20.0

Pushed: 2017-01-10 16:18:05.0

Homepage:

Size: 16

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

react-twitter-widgets

Alleviates the need for Twitter's default 2008-style widget snippets.

Available widgets: Timeline, Share, Follow, Hashtag, Mention, Tweet.

See below for usage.

Installation
install --save react-twitter-widgets
Example
rt { Timeline } from 'react-twitter-widgets'
ar Timeline = require('react-twitter-widgets').Timeline

tDOM.render((
imeline
dataSource={{
  sourceType: 'profile',
  screenName: 'twitterdev'
}}
options={{
  username: 'TwitterDev',
  height: '400'
}}
onLoad={() => console.log('Timeline is loaded!')}

ocument.getElementById('root'))

Usage

Available widgets: Timeline, Share, Follow, Hashtag, Mention, Tweet

All widgets take an optional options object prop. To learn more about the available options (height, width, align, count, etc), see this link.

Timeline requires a dataSource object prop, see here for info. The source type can be profile, likes, list, collection, URL, or legacy widget configuration.

Share requires a url prop.

Follow and Mention require a username prop.

Hashtag requires a hashtag prop.

Tweet requires a tweetId prop. Ex. '511181794914627584'

All widgets accept an optional onLoad callback, which is called every time the widget is loaded/reloaded (both on inital load and updates).

Contributing
  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request
Credits
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.