Doesn't work with React.js 17
I am using CRA 5.0.0, and try to install this npm-module. Then I got this error message:
PS C:\temp\temp\helloworld> npm install react-web-component npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"^17.0.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.2.0" from [email protected] npm ERR! node_modules/react-web-component npm ERR! react-web-component@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR!
Same issue with react 18.2. Is this a dead project?
The library have peerDependency for react 16.2.0, so you need use the same version.
I try to force with npm install --force react-web-component and still work with react 17.0.2 because the only dependency affected is ReactDom.render and React.cloneElement, but if you use react 18 maybe don't work because the render method is replaced by createRoot (https://beta.reactjs.org/reference/react-dom/render)
Is something :)
EDIT: --legacy-peer-deps option also is an alternative