sindresorhus/linkify-urls

Output React component

Opened this issue · 1 comments

import {LinkifyUrls} from "linkify-urls/react"

<LinkifyUrls
	string='a string with https://example.com'
	target="_blank"
/>

Does it make sense as part of this module? The current solution:

<div
  dangerouslySetInnerHTML={{
    __html: linkifyUrls('a string with https://example.com', {
      attributes: {
        target: "_blank",
      },
    }),
  }}
></div>

React does not accept DocumentFragment and other raw elements.

Sure