Not a Propaganda Machine

    react-nl2br
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.4 • 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

    13,380

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    4.71 kB

    Total Files

    7

    Last publish

    Collaborators

    • yosuke-furukawa