How to Easily Preview Twitter Content in Your React Native App with react-native-twitter-preview

Idan Levi
1 min readApr 14, 2023
Photo by Ravi Sharma on Unsplash

As a React Native developer, I often need to display Twitter content in my apps. However, I found that there wasn’t an easy solution to do this without registering a developer account on Twitter and using a lot of code. That’s why I created react-native-twitter-preview, a simple and lightweight npm package that makes it easy to involve Twitter content in your app. Whether you want to display tweets, profiles, or hashtags, this package have you covered.

Features:

  • Preview tweets, profiles, and hashtags in your app
  • Customizable styling options
  • Works with both iOS and Android

Getting Started!
To use react-native-twitter-preview in your React Native project, simply install:

yarn add react-native-twitter-preview
yarn add react-native-webview
cd ios && pod install

Then, import it into your project and use it like this:

import TwitterPreview from 'react-native-twitter-preview';

<TwitterPreview
url={'https://twitter.com/elonmusk/status/1636162726140493825'}
backgroundColor={'#272A35'}
/>

This code will render a preview of the tweet of https://twitter.com/elonmusk/status/1636162726140493825
can you also display a profile or hashtags

Give it a try and let me know what you think! Check out the GitHub repository for more information and examples.
npm / Github

--

--