Output React component
fregante opened this issue · 1 comments
fregante commented
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.
sindresorhus commented
Sure