Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

react-nl2br

0.4.0 • Public • Published

react-nl2br

USAGE

const nl2br = require('react-nl2br');
const result = nl2br('aaa\nbbb\nccc\nddd');
console.log(result); // aaa, ReactElement('br'), bbb, ReactElement('br'), ccc, ReactElement('br'), ddd

in jsx

const React = require('react');
const nl2br = require('react-nl2br');
var Hello = React.createClass({
  render: function() {
    return (
      <div>Hello {nl2br(this.props.name)}</div>
    );
  }
});

INSTALL

$ npm install react-nl2br -S

Keywords

install

npm i react-nl2br

Downloadsweekly downloads

6,291

version

0.4.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability