0.1.5 • Published 2 years ago

rn-tweet-embed v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rn-tweet-embed

WebView based embedded Tweet for React Native

Installation

npm install rn-tweet-embed

or

yarn add rn-tweet-embed

Props

You must pass either tweetUrl or tweetId for this to work.

tweetUrl - Tweet URL (eg: https://twitter.com/reactnative/status/20)

TypeRequired
stringNo

tweetId - Tweet ID (eg: 20)

TypeRequired
string or numberNo

webViewProps - Props passed to the WebView

TypeRequired
WebView propsNo

embedParams - Tweet embed params

TypeRequired
Tweet embed paramsNo

theme - Color theme

TypeRequired
'light' or 'dark'No

interceptPress - Optional callback to intercept widget press

TypeRequire
() => voidNo

Usage

import { Tweet } from "rn-tweet-embed";

const App = () => {
  const [theme, setTheme] = useState('light');

  const _onPress = () => {
    // handle widget press
  }

  return (
    <Tweet
      interceptPress={_onPress}
      theme={theme}
      tweetUrl="https://twitter.com/reactnative/status/20"
    />
  )
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT