rn-tweet-embed
v0.1.5
Published
WebView based embedded Tweet for React Native
Downloads
14
Maintainers
Readme
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
)
| Type | Required |
|----------|----------|
| string
| No |
tweetId
- Tweet ID (eg: 20
)
| Type | Required |
|----------------------|----------|
| string
or number
| No |
webViewProps
- Props passed to the WebView
| Type | Required | |-----------------------------------------------------------------------------------------------------------------------------------------------|----------| | WebView props | No |
embedParams
- Tweet embed params
| Type | Required | |--------------------------------------------------------------------------------------------------------------------------------------------|----------| | Tweet embed params | No |
theme
- Color theme
| Type | Required |
|-----------------------|----------|
| 'light'
or 'dark'
| No |
interceptPress
- Optional callback to intercept widget press
| Type | Require |
|--------------|---------|
| () => void
| No |
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