react-fake-tweet
v1.0.7
Published
React renderer for tweets.
Downloads
21
Readme
react-fake-tweet
React renderer for tweets.
This project is a fork of fake-tweet by Lluís Camino with the following improvements:
- Uses CSS modules to not pollute CSS namespace
- Allows you to override className, style, etc on root element
- Smaller bundle size via microbundle
- Fixes some style issues
- Used in production by twitter-search.io
Install
npm install --save react-fake-tweet
Usage
import React, { Component } from 'react'
import { Tweet } from 'react-fake-tweet'
import 'react-fake-tweet/dist/index.css'
const tweet = {
/* ... */
}
class Example extends Component {
render() {
return (
<Tweet
config={{
user: {
avatar: tweet.user.profile_image_url,
nickname: tweet.user.screen_name,
name: tweet.user.name
},
text: tweet.text,
date: Date.now(),
retweets: tweet.retweet_count,
likes: tweet.favorite_count
}}
/>
)
}
}
Related
- react-tweet-embed - Embeds a tweet using Twitter's official embedding SDK.
- Significantly more accurate and robust
- Slightly more heavy-weight
- No way that I'm aware of to fake the resulting tweet's content
License
MIT © transitive-bullshit