1.0.0 • Published 4 months ago

@greenlabs/rescript-react-linkify v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

rescript-react-linkify

Install

npm i @greenlabs/rescript-react-linkify
or
yarn add @greenlabs/rescript-react-linkify
"bs-dependencies": [
  "@greenlabs/rescript-react-linkify"
]

Usage

@react.component
let make = () => {
<Linkify
  componentDecorator={(decoratedHref, decoratedText, index) => {
    <a
      target="_blank"
      key={decoratedHref ++ decoratedText ++ Int.toString(index)}
      href={decoratedHref}>
      {decoratedText->React.string}
    </a>
  }}>
  {"Contents"->React.string}
</Linkify>
}