0.1.5 • Published 4 years ago
rn-tweet-embed v0.1.5
rn-tweet-embed
WebView based embedded Tweet for React Native
Installation
npm install rn-tweet-embedor
yarn add rn-tweet-embedProps
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