react-html-parser
react-html-parser copied to clipboard
Support for react 17
I just updated to react 17, which gave me this message:
npm WARN [email protected] requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself.
It'd be great if this could be updated to say it supports React 17. Since there are no feature changes in React 17, it can basically be used as is.
npm install react-html-parser --legacy-peer-deps - its work
Can we get this https://github.com/peternewnham/react-html-parser/pull/80 merged?
@durgeshrkumari I left a comment in the merge request about the htmlparser2 dep. Without changing it, I was getting runtime errors in my tests.
On React v17, tried with and without "npm install react-html-parser --legacy-peer-deps" and still getting errors as: "Compiled with problems: ERROR in ./node_modules/react-html-parser/node_modules/htmlparser2/lib/WritableStream.js 9:13-37 Module not found: Error: Can't resolve 'buffer' in ..." Any help?
i found fork https://github.com/hedgedoc/html-to-react can it help?
I'm using react 18.2 and have a similar issue.
warning " > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0-0".
On React v17, tried with and without "npm install react-html-parser --legacy-peer-deps" and still getting errors as: "Compiled with problems: ERROR in ./node_modules/react-html-parser/node_modules/htmlparser2/lib/WritableStream.js 9:13-37 Module not found: Error: Can't resolve 'buffer' in ..." Any help?
react-html-parser uses an old version of the htmlparser2 package (3.9.2), which uses NodeJS APIs such as Buffer (example).
Since Webpack v5, these NodeJS APIs are no longer included by default, you probably need to install node-polyfill-webpack-plugin and add it to the plugins section of your Webpack configuration.
thanks. i use webpack 4 and 3.
Yes i'm also facing the same problem , i use for react 17 version this react 17 version support for react-html-parser 3.0.9
npm install react-html-parser --legacy-peer-deps - its work
Its fails on deployment