This react library converts plain text tweets into real tweets. The library is responsible for parsing the tweets and handles transform mention (@monAmiTweetos), hashtags (#RTplz) and URLs inserted in the tweet in functional URLs. This library was created based on jquery-tweet-parser

Install react-tweet-parser

npm install react-tweet-parser --save

Import TweetParser

import TweetParser from 'react-tweet-parser';

Properties 

  1. urlClass - CSS class for URL
  2. userClass - CSS class for user links
  3. hashtagClass - CSS class for twitter user links
  4. target - link target attribute value (exp : _blank)
  5. searchWithHashtags - It will give q parameter 
  6. parseUsers - Parser users boolean flag 
  7. parseUrls - Parse urls boolean flag
  8. parseHashtags - Parse hashtags boolean flag

Usage

Use TweetParser component like below
<TweetParser
         urlClass = {"myUrlClass"}
         userClass = {"myUserClass"}
        >plain tweet text</TweetParser>

0 comments:

Blogroll

Follow this blog by Email

Popular Posts