Skip to content

Commit db63761

Browse files
committed
Update README
1 parent 652a59b commit db63761

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
# React HTML Parser
22

3-
Avoid using dangerouslySetInnerHTML by parsing HTML strings directly into React components.
3+
A utility library for converting HTML strings into [React](https://facebook.github.io/react/) components. Avoids the use of dangerouslySetInnerHTML and converts standard HTML elements, attributes and inline styles into their React equivalents.
4+
5+
[Try the Live Demo](https://wrakky.github.io/react-html-parser)
46

57
[![Travis branch](https://img.shields.io/travis/wrakky/react-html-parser/master.svg)](https://travis-ci.org/wrakky/react-html-parser)
68
[![Coveralls](https://img.shields.io/coveralls/wrakky/react-html-parser.svg)](https://coveralls.io/github/wrakky/react-html-parser)
79
[![npm](https://img.shields.io/npm/v/react-html-parser.svg)](https://www.npmjs.com/package/react-html-parser)
8-
[![David](https://img.shields.io/david/wrakky/react-html-parser.svg)](https://david-dm.org/wrakky/react-html-parser)
10+
[![David](https://img.shields.io/david/wrakky/react-html-parser.svg)](https://david-dm.org/wrakky/react-html-parser)
11+
12+
## Install
13+
14+
```
15+
npm install react-html-parser
16+
```
17+
18+
## Usage
19+
20+
```javascript
21+
import React from 'react';
22+
import ReactHtmlParser from 'react-html-parser';
23+
24+
class HtmlComponent extends React.Component {
25+
render() {
26+
const html = '<div>Example HTML string</div>';
27+
return <div>{ ReactHtmlParser(html) }</div>;
28+
}
29+
}
30+
```

0 commit comments

Comments
 (0)