Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yosuke-furukawa/react-nl2br
Newlines to <br /> for React
https://github.com/yosuke-furukawa/react-nl2br
nl2br react
Last synced: 18 days ago
JSON representation
Newlines to <br /> for React
- Host: GitHub
- URL: https://github.com/yosuke-furukawa/react-nl2br
- Owner: yosuke-furukawa
- License: mit
- Created: 2015-09-28T14:25:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T13:45:23.000Z (7 months ago)
- Last Synced: 2024-04-15T12:17:35.403Z (7 months ago)
- Topics: nl2br, react
- Language: JavaScript
- Size: 138 KB
- Stars: 78
- Watchers: 4
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
react-nl2br
==============# USAGE
```javascript
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
```javascript
const React = require('react');
const nl2br = require('react-nl2br');
var Hello = React.createClass({
render: function() {
return (
Hello {nl2br(this.props.name)}
);
}
});
```# INSTALL
```
$ npm install react-nl2br -S
```