green-labs / rescript-bindings

💚 rescript bindings
49 stars 0 forks source link

init: react-linkify #18

Closed HyoJeong1019 closed 2 years ago

HyoJeong1019 commented 2 years 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>
}

작고 귀여운 linkify 바인딩을 추가하러 왔습니다🙌🏻