Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 672 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 672 Bytes

A React component for formatting paragraphs, line breaks and links.

<FormattedText>
  Email me ([email protected]) or visit foo.example.com.
</FormattedText>
<div>
  <p>
    Email me (<a href="mailto:[email protected]">[email protected]</a>) or visit <a href="http://foo.example.com">foo.example.com</a>.
  </p>
</div>

Props

renderLink

A function that receives {url, text} and returns what to render in place of the found link. By default this function simply returns <a href={url}>{text}</a>, but can be customized to turn YouTube/SoundCloud/etc links into embedded media. See the example page for a demonstration.