0.0.1 • Published 2 years ago

@itartist/react-native-opengraph-parser v0.0.1

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

React Native OpenGraph Parser

Getting Started

yarn add @itartist/react-native-opengraph-parser

Usage

import { LinkPreview } from '@itartist/react-native-opengraph-parser'
// ...
return (
  <LinkPreview text='This link https://github.com/itartist can be extracted from the text' />
)

Props

Required

NameTypeDescription
textstringText to extract the link from

Optional

NameTypeDescription
containerStyleViewStyleTop level container style
enableAnimationbooleanEnables LayoutAnimation
headerstringText above the link
metadataContainerStyleViewStyleTitle, description and minimized image container style
metadataTextContainerStyleViewStyleTitle and description container style
onPreviewDataFetched(PreviewData) => voidCallback to get the fetched preview data
previewDataPreviewDataData to render instead of parsing the provided text
renderDescription(string) => ReactNodeCustom description render prop
renderHeader(string) => ReactNodeCustom header render prop
renderImage(PreviewDataImage) => ReactNodeCustom image render prop
renderLinkPreview({ aspectRatio?: number, containerWidth: number, previewData?: PreviewData }) => ReactNodeCustom render prop
renderMinimizedImage(PreviewDataImage) => ReactNodeCustom minimised image render prop
renderText(string) => ReactNodeCustom provided text render prop
renderTitle(string) => ReactNodeCustom title render prop
textContainerStyleViewStyleText, title, description and minimized image container style
touchableWithoutFeedbackPropsTouchableWithoutFeedbackPropsTop level touchable props

License

MIT