Closed priyadarshiniMuthuraman closed 2 years ago
Hi, react-html-parser
is the npm package of the original version of this lib that is hosted here: https://github.com/peternewnham/react-html-parser .
THIS repo is a hard fork that we created because we use the lib in your project and needed a maintained version. It is available on npm under @hedgedoc/html-to-react
. Sorry for the wrong package name in the README :sweat_smile: . I just updated it.
@mrdrogdrog Thank you your swift update It worked. You need to change the usage part in Readme file
Usage
import React from 'react';
import convertHtmlToReact from '@hedgedoc/html-to-react';
class HtmlComponent extends React.Component {
render() {
const html = '<div>Example HTML string</div>';
return <div>{ ReactHtmlParser(html) }</div>;
}
}
from ReactHtmlParser(html) to convertHtmlToReact (html, true);
Edit by @ErikMichelson: Usage of code blocks for easier reading
My react version is 17.0.2 but I am unable to install the react-html-parser, getting the error has below. Kindly guide on this.