File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ An HTML to React parser:
13
13
Parser(htmlString[, options])
14
14
```
15
15
16
- The parser converts a string of HTML to [ React Element(s)] ( https://facebook.github.io/react/docs/glossary .html#react-elements ) .
16
+ The parser converts an HTML string to [ React Element(s)] ( https://facebook.github.io/react/docs/react-api .html#creating- react-elements ) .
17
17
18
18
There is also an option to [ replace] ( #replacedomnode ) element(s) with your own React Element(s) via the [ parser options] ( #options ) .
19
19
@@ -25,6 +25,8 @@ Parser('<p>Hello, world!</p>');
25
25
// same output as `React.createElement('p', {}, 'Hello, world!')`
26
26
```
27
27
28
+ [ JSFiddle] ( https://jsfiddle.net/remarkablemark/7v86d800/ )
29
+
28
30
## Installation
29
31
30
32
[ NPM] ( https://www.npmjs.com/package/html-react-parser ) :
@@ -42,8 +44,9 @@ $ npm install html-react-parser@0.2
42
44
[ CDN] ( https://unpkg.com/html-react-parser/ ) :
43
45
44
46
``` html
45
- <!-- HTMLReactParser depends on React -->
47
+ <!-- HTMLReactParser depends on React and ReactDOM -->
46
48
<script src =" https://unpkg.com/react@latest/dist/react.min.js" ></script >
49
+ <script src =" https://unpkg.com/react-dom@latest/dist/react-dom.min.js" ></script >
47
50
<script src =" https://unpkg.com/html-react-parser@latest/dist/html-react-parser.min.js" ></script >
48
51
```
49
52
You can’t perform that action at this time.
0 commit comments