Nasal Piercings Manipulator
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

textwithnewlines

1.1.0 • Public • Published

TextWithNewlines

A React Component for turning text with newlines into semantic paragraphs.

Installation

npm install --save textwithnewlines

Usage

import TextWithNewlines from "textwithnewlines";
 
const sampleText = `The first paragraph
 
Another paragraph.
 
A third paragraph`;
 
class App extends React.Component {
  render() {
    return <TextWithNewlines>{sampleText}</TextWithNewlines>;
  }
}

Which will output:

<div>
  <p>
    First Paragraph
  </p>
  <p>
    Second Paragraph
  </p>
  <p>
    Third Paragraph
  </p>
</div>

Install

npm i textwithnewlines

DownloadsWeekly Downloads

10

Version

1.1.0

License

MIT

Unpacked Size

84 kB

Total Files

10

Last publish

Collaborators

  • avatar