Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

react-nl2br

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-nl2br

newlines like '\n', '\n\r' to for React

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
30K
37.71%
Maintainers
1
Weekly downloads
 
Created
Source

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

react

FAQs

Package last updated on 04 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts