textwithnewlines
v1.1.0
Published
A React Component for turning text with newlines into semantic paragraphs
Downloads
14
Maintainers
Readme
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>